HCE project C++ developers source code library  1.1.1
HCE project developer library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
BaseDB.hpp
Go to the documentation of this file.
1 
15 #ifndef BASE_DB_HPP
16 #define BASE_DB_HPP
17 
18 
22 #include <Poco/SharedPtr.h>
23 
27 #include <iostream>
28 #include <string>
29 #include <list>
30 
31 
35 #include "Errors.hpp"
36 
37 
38 namespace HCE
39 {
40 
41 typedef int STATUS;
42 
47 class BaseDB
48 {
49 public:
51  virtual ~BaseDB() {}
52 public:
53  typedef Poco::SharedPtr<HCE::BaseDB> BaseDBPtr;
54 public:
59  virtual inline void setDatabaseName(const std::string& dbName) { _dbName = dbName; }
64  virtual inline void setDriverUrl(const std::string& dbUrl) { _bootstrapUrls.push_back(dbUrl); }
65 public:
75  virtual void put(const std::string& key, const std::string& value) = 0;
85  virtual std::string get(const std::string& key) = 0;
95  virtual std::vector<std::string> get_all() = 0;
105  virtual void del(const std::string& key) = 0;
111  virtual int getLastError() const = 0;//{ return _error; }
112 protected:
113  std::string _dbName;
114  std::list<std::string> _bootstrapUrls;
116 };
117 
118 
119 }
120 
121 
122 #endif