Public Member Functions | List of all members
ndn::Sqlite3ProducerDb Class Reference

Sqlite3ProducerDb extends ProducerDb to implement storage of keys for the producer using SQLite3. More...

#include <sqlite3-producer-db.hpp>

Inheritance diagram for ndn::Sqlite3ProducerDb:
ndn::ProducerDb

Public Member Functions

 Sqlite3ProducerDb (const std::string &databaseFilePath)
 Create an Sqlite3ProducerDb to use the given SQLite3 file. More...
 
virtual bool hasContentKey (MillisecondsSince1970 timeSlot)
 Check if a content key exists for the hour covering timeSlot. More...
 
virtual Blob getContentKey (MillisecondsSince1970 timeSlot)
 Get the content key for the hour covering timeSlot. More...
 
virtual void addContentKey (MillisecondsSince1970 timeSlot, const Blob &key)
 Add key as the content key for the hour covering timeSlot. More...
 
virtual void deleteContentKey (MillisecondsSince1970 timeSlot)
 Delete the content key for the hour covering timeSlot. More...
 
- Public Member Functions inherited from ndn::ProducerDb
virtual ~ProducerDb ()
 The virtual Destructor.
 

Additional Inherited Members

- Static Protected Member Functions inherited from ndn::ProducerDb
static int getFixedTimeSlot (MillisecondsSince1970 timeSlot)
 Get the hour-based time slot. More...
 

Detailed Description

Sqlite3ProducerDb extends ProducerDb to implement storage of keys for the producer using SQLite3.

It contains one table that maps time slots (to the nearest hour) to the content key created for that time slot.

Note
This class is an experimental feature. The API may change.

Constructor & Destructor Documentation

ndn::Sqlite3ProducerDb::Sqlite3ProducerDb ( const std::string &  databaseFilePath)

Create an Sqlite3ProducerDb to use the given SQLite3 file.

Parameters
databaseFilePathThe path of the SQLite file.

Member Function Documentation

virtual void ndn::Sqlite3ProducerDb::addContentKey ( MillisecondsSince1970  timeSlot,
const Blob key 
)
virtual

Add key as the content key for the hour covering timeSlot.

Parameters
timeSlotThe time slot as milliseconds since Jan 1, 1970 UTC.
keyThe encoded key.
Exceptions
ProducerDb::Errorif a key for the same hour already exists in the database, or other database error.

Implements ndn::ProducerDb.

virtual void ndn::Sqlite3ProducerDb::deleteContentKey ( MillisecondsSince1970  timeSlot)
virtual

Delete the content key for the hour covering timeSlot.

If there is no key for the time slot, do nothing.

Parameters
timeSlotThe time slot as milliseconds since Jan 1, 1970 UTC.
Exceptions
ProducerDb::Errorfor a database error.

Implements ndn::ProducerDb.

virtual Blob ndn::Sqlite3ProducerDb::getContentKey ( MillisecondsSince1970  timeSlot)
virtual

Get the content key for the hour covering timeSlot.

Parameters
timeSlotThe time slot as milliseconds since Jan 1, 1970 UTC.
Returns
A Blob with the encoded key.
Exceptions
ProducerDb::Errorif there is no key covering timeSlot or other database error.

Implements ndn::ProducerDb.

virtual bool ndn::Sqlite3ProducerDb::hasContentKey ( MillisecondsSince1970  timeSlot)
virtual

Check if a content key exists for the hour covering timeSlot.

Parameters
timeSlotThe time slot as milliseconds since Jan 1, 1970 UTC.
Returns
True if there is a content key for timeSlot.
Exceptions
ProducerDb::Errorfor a database error.

Implements ndn::ProducerDb.


The documentation for this class was generated from the following file: