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 <sqlite3.h>
31 #include "../common.hpp"
32 #include "producer-db.hpp"
33 
34 namespace ndn {
35 
42 class Sqlite3ProducerDb : public ProducerDb {
43 public:
48  Sqlite3ProducerDb(const std::string& databaseFilePath);
49 
56  virtual bool
58 
66  virtual Blob
68 
76  virtual void
77  addContentKey(MillisecondsSince1970 timeSlot, const Blob& key);
78 
85  virtual void
87 
88 private:
89  sqlite3 *database_;
90 };
91 
92 }
93 
94 #endif // NDN_CPP_HAVE_SQLITE3
95 
96 #endif
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:36
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:42
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.
Definition: blob.hpp:42
double MillisecondsSince1970
The calendar time represented as the number of milliseconds since 1/1/1970.
Definition: common.hpp:117
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.