All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
sqlite3-producer-db.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
23 #ifndef NDN_SQLITE3_PRODUCER_DB_HPP
24 #define NDN_SQLITE3_PRODUCER_DB_HPP
25 
26 // Only compile if ndn-cpp-config.h defines NDN_CPP_HAVE_SQLITE3.
27 #include "../ndn-cpp-config.h"
28 #ifdef NDN_CPP_HAVE_SQLITE3
29 
30 #include "../common.hpp"
31 #include "producer-db.hpp"
32 
33 struct sqlite3;
34 
35 namespace ndn {
36 
43 class Sqlite3ProducerDb : public ProducerDb {
44 public:
49  Sqlite3ProducerDb(const std::string& databaseFilePath);
50 
57  virtual bool
59 
67  virtual Blob
69 
77  virtual void
78  addContentKey(MillisecondsSince1970 timeSlot, const Blob& key);
79 
86  virtual void
88 
89 private:
90  struct sqlite3 *database_;
91 };
92 
93 }
94 
95 #endif // NDN_CPP_HAVE_SQLITE3
96 
97 #endif
virtual Blob getContentKey(MillisecondsSince1970 timeSlot)
Get the content key for the hour covering timeSlot.
Sqlite3ProducerDb extends ProducerDb to implement storage of keys for the producer using SQLite3...
Definition: sqlite3-producer-db.hpp:43
virtual void addContentKey(MillisecondsSince1970 timeSlot, const Blob &key)
Add key as the content key for the hour covering timeSlot.
virtual bool hasContentKey(MillisecondsSince1970 timeSlot)
Check if a content key exists for the hour covering timeSlot.
A Blob holds a pointer to an immutable byte array implemented as const std::vector<uint8_t>.
Definition: blob.hpp:42
double MillisecondsSince1970
The calendar time represented as the number of milliseconds since 1/1/1970.
Definition: common.hpp:119
virtual void deleteContentKey(MillisecondsSince1970 timeSlot)
Delete the content key for the hour covering timeSlot.
ProducerDb is an abstract base class for the storage of keys for the producer.
Definition: producer-db.hpp:37
Sqlite3ProducerDb(const std::string &databaseFilePath)
Create an Sqlite3ProducerDb to use the given SQLite3 file.