rad  3.0.0
dbInterface.hpp
Go to the documentation of this file.
1 
9 #ifndef HELLOMAL_DB_INTERFACE_HPP_
10 #define HELLOMAL_DB_INTERFACE_HPP_
11 
12 #include <rad/dbAdapter.hpp>
13 
14 #include <string>
15 
16 namespace hellomal {
17 
18 const std::string KEY_CONTROL_STATE = "ctr.state";
19 
20 const std::string KEY_CONFIG_REQ_ENDPOINT = "cfg.req.endpoint";
21 const std::string KEY_CONFIG_DB_ENDPOINT = "cfg.db.endpoint";
22 const std::string KEY_CONFIG_DB_TIMEOUT_SEC = "cfg.db.timeout.sec";
23 const std::string KEY_CONFIG_SM_SCXML = "cfg.sm.scxml";
24 const std::string KEY_CONFIG_FILENAME = "cfg.filename";
25 const std::string KEY_CONFIG_LOG_LEVEL = "cfg.log.level";
26 const std::string KEY_CONFIG_LOG_PROPERTIES = "cfg.log.properties";
27 
28 class Config;
29 
30 
34 class DbInterface {
35  public:
42  DbInterface(const std::string& prefix, rad::DbAdapter& runtime_db);
43 
47  virtual ~DbInterface();
48 
52  std::string GetControlState();
53 
58  std::string Get(const std::string& key);
59 
63  void SetControlState(const std::string& value);
64 
73  void SetConfig(Config& cfg);
74 
79  void Set(const std::string& key, const std::string& value);
80 
81  DbInterface(const DbInterface&) = delete;
82  DbInterface& operator=(const DbInterface&) = delete;
83 
84  private:
85  std::string m_prefix;
86  rad::DbAdapter& m_runtime_db;
87 };
88 
89 } // namespace hellomal
90 
91 #endif // HELLOMAL_DB_INTERFACE_HPP_
hellomal::DbInterface::SetControlState
void SetControlState(const std::string &value)
Definition: dbInterface.cpp:44
hellomal::KEY_CONFIG_DB_ENDPOINT
const std::string KEY_CONFIG_DB_ENDPOINT
Definition: dbInterface.hpp:21
hellomal::KEY_CONFIG_LOG_LEVEL
const std::string KEY_CONFIG_LOG_LEVEL
Definition: dbInterface.hpp:25
hellomal::DbInterface
Definition: dbInterface.hpp:34
hellomal::DbInterface::SetConfig
void SetConfig(Config &cfg)
Definition: dbInterface.cpp:49
hellomal::DbInterface::Get
std::string Get(const std::string &key)
Definition: dbInterface.cpp:39
hellomal::KEY_CONFIG_DB_TIMEOUT_SEC
const std::string KEY_CONFIG_DB_TIMEOUT_SEC
Definition: dbInterface.hpp:22
hellomal::KEY_CONTROL_STATE
const std::string KEY_CONTROL_STATE
Definition: dbInterface.hpp:18
hellomal
Definition: actionMgr.cpp:21
hellomal::DbInterface::GetControlState
std::string GetControlState()
Definition: dbInterface.cpp:34
hellomal::KEY_CONFIG_LOG_PROPERTIES
const std::string KEY_CONFIG_LOG_PROPERTIES
Definition: dbInterface.hpp:26
hellomal::DbInterface::operator=
DbInterface & operator=(const DbInterface &)=delete
Disable copy constructor.
hellomal::Config
Definition: config.hpp:40
hellomal::DbInterface::DbInterface
DbInterface(const std::string &prefix, rad::DbAdapter &runtime_db)
Definition: dbInterface.cpp:20
hellomal::KEY_CONFIG_SM_SCXML
const std::string KEY_CONFIG_SM_SCXML
Definition: dbInterface.hpp:23
hellomal::KEY_CONFIG_REQ_ENDPOINT
const std::string KEY_CONFIG_REQ_ENDPOINT
Definition: dbInterface.hpp:20
hellomal::DbInterface::~DbInterface
virtual ~DbInterface()
Definition: dbInterface.cpp:30
hellomal::KEY_CONFIG_FILENAME
const std::string KEY_CONFIG_FILENAME
Definition: dbInterface.hpp:24
rad::DbAdapter
Definition: dbAdapter.hpp:29
hellomal::DbInterface::DbInterface
DbInterface(const DbInterface &)=delete
hellomal::DbInterface::Set
void Set(const std::string &key, const std::string &value)
Definition: dbInterface.cpp:72