ProducerDb is an abstract base class for the storage of keys for the producer. More...
#include <producer-db.hpp>
Classes | |
| class | Error |
| ProducerDb::Error extends std::exception for errors using ProducerDb methods. More... | |
Public Member Functions | |
| virtual | ~ProducerDb () |
| The virtual Destructor. | |
| virtual bool | hasContentKey (MillisecondsSince1970 timeSlot)=0 |
| Check if a content key exists for the hour covering timeSlot. More... | |
| virtual Blob | getContentKey (MillisecondsSince1970 timeSlot)=0 |
| Get the content key for the hour covering timeSlot. More... | |
| virtual void | addContentKey (MillisecondsSince1970 timeSlot, const Blob &key)=0 |
| Add key as the content key for the hour covering timeSlot. More... | |
| virtual void | deleteContentKey (MillisecondsSince1970 timeSlot)=0 |
| Delete the content key for the hour covering timeSlot. More... | |
Static Protected Member Functions | |
| static int | getFixedTimeSlot (MillisecondsSince1970 timeSlot) |
| Get the hour-based time slot. More... | |
ProducerDb is an abstract base class for the storage of keys for the producer.
It contains one table that maps time slots (to the nearest hour) to the content key created for that time slot. A subclass must implement the methods. For example, see Sqlite3ProducerDb.
|
pure virtual |
Add key as the content key for the hour covering timeSlot.
| timeSlot | The time slot as milliseconds since Jan 1, 1970 UTC. |
| key | The encoded key. |
| ProducerDb::Error | if a key for the same hour already exists in the database, or other database error. |
Implemented in ndn::Sqlite3ProducerDb.
|
pure virtual |
Delete the content key for the hour covering timeSlot.
If there is no key for the time slot, do nothing.
| timeSlot | The time slot as milliseconds since Jan 1, 1970 UTC. |
| ProducerDb::Error | for a database error. |
Implemented in ndn::Sqlite3ProducerDb.
|
pure virtual |
Get the content key for the hour covering timeSlot.
| timeSlot | The time slot as milliseconds since Jan 1, 1970 UTC. |
| ProducerDb::Error | if there is no key covering timeSlot or other database error. |
Implemented in ndn::Sqlite3ProducerDb.
|
staticprotected |
Get the hour-based time slot.
| timeSlot | The time slot as milliseconds since Jan 1, 1970 UTC. |
|
pure virtual |
Check if a content key exists for the hour covering timeSlot.
| timeSlot | The time slot as milliseconds since Jan 1, 1970 UTC. |
| ProducerDb::Error | for a database error. |
Implemented in ndn::Sqlite3ProducerDb.
1.8.6