OpenDaVINCI  4.16.0
SimpleDB.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_CORE_WRAPPER_SIMPLEDB_SIMPLEDB_H_
21 #define OPENDAVINCI_CORE_WRAPPER_SIMPLEDB_SIMPLEDB_H_
22 
23 #include <map>
24 #include <memory>
25 #include <string>
26 
30 
31 namespace odcore { namespace wrapper { class Mutex; } }
32 namespace odcore { namespace wrapper { template <odcore::wrapper::KeyValueDatabaseLibraryProducts product> class KeyValueDatabaseFactoryWorker; } }
33 
34 namespace odcore {
35  namespace wrapper {
36  namespace SimpleDB {
37 
38  using namespace std;
39 
40  class SimpleDB : public KeyValueDatabase {
42  private:
48  SimpleDB(const SimpleDB &);
49 
55  SimpleDB& operator=(const SimpleDB &);
56 
57  protected:
58  SimpleDB();
59 
60  public:
61  virtual ~SimpleDB();
62 
63  virtual void put(const int32_t &key, const string &value);
64 
65  virtual const string get(const int32_t &key) const;
66 
67  protected:
68  unique_ptr<Mutex> m_mutex;
69  mutable map<int, string> m_entries;
70  };
71 
72  }
73  }
74 } // odcore::wrapper::SimpleDB
75 
76 #endif /*OPENDAVINCI_CORE_WRAPPER_SIMPLEDB_SIMPLEDB_H_*/
Definition: KeyValueDatabaseLibraryProducts.h:35
Definition: SimpleDB.h:40
Definition: KeyValueDatabaseFactoryWorker.h:44
Definition: KeyValueDatabase.h:38
unique_ptr< Mutex > m_mutex
Definition: SimpleDB.h:68
map< int, string > m_entries
Definition: SimpleDB.h:69