producer-db.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
23 #ifndef NDN_PRODUCER_DB_HPP
24 #define NDN_PRODUCER_DB_HPP
25 
26 #include "../util/blob.hpp"
27 
28 namespace ndn {
29 
37 class ProducerDb {
38 public:
43  class Error : public std::exception {
44  public:
45  Error(const std::string& errorMessage) throw();
46 
47  virtual ~Error() throw();
48 
49  std::string
50  Msg() const { return errorMessage_; }
51 
52  virtual const char*
53  what() const throw();
54 
55  private:
56  const std::string errorMessage_;
57  };
58 
62  virtual
63  ~ProducerDb();
64 
71  virtual bool
73 
81  virtual Blob
83 
91  virtual void
92  addContentKey(MillisecondsSince1970 timeSlot, const Blob& key) = 0;
93 
100  virtual void
102 
103 protected:
109  static int
111 };
112 
113 }
114 
115 #endif
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:36
virtual void addContentKey(MillisecondsSince1970 timeSlot, const Blob &key)=0
Add key as the content key for the hour covering timeSlot.
virtual ~ProducerDb()
The virtual Destructor.
Definition: producer-db.cpp:43
virtual Blob getContentKey(MillisecondsSince1970 timeSlot)=0
Get the content key for the hour covering timeSlot.
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
virtual bool hasContentKey(MillisecondsSince1970 timeSlot)=0
Check if a content key exists for the hour covering timeSlot.
static int getFixedTimeSlot(MillisecondsSince1970 timeSlot)
Get the hour-based time slot.
Definition: producer-db.cpp:46
double MillisecondsSince1970
The calendar time represented as the number of milliseconds since 1/1/1970.
Definition: common.hpp:117
ProducerDb is an abstract base class for the storage of keys for the producer.
Definition: producer-db.hpp:37
virtual void deleteContentKey(MillisecondsSince1970 timeSlot)=0
Delete the content key for the hour covering timeSlot.
ProducerDb::Error extends std::exception for errors using ProducerDb methods.
Definition: producer-db.hpp:43