rad 8.2.0
Loading...
Searching...
No Matches
dbInterface.hpp
Go to the documentation of this file.
1
9#ifndef {{cookiecutter.module_name|upper}}_DB_INTERFACE_HPP_
10#define {{cookiecutter.module_name|upper}}_DB_INTERFACE_HPP_
11
12#include <rad/dbAdapter.hpp>
13
14#include <string>
15
16namespace {{cookiecutter.module_name}} {
17
18const std::string KEY_CONTROL_STATE = "ctr.state";
19
20const std::string KEY_CONFIG_REQ_ENDPOINT = "cfg.req.endpoint";
21const std::string KEY_CONFIG_DB_ENDPOINT = "cfg.db.endpoint";
22const std::string KEY_CONFIG_DB_TIMEOUT_SEC = "cfg.db.timeout.sec";
23const std::string KEY_CONFIG_SM_SCXML = "cfg.sm.scxml";
24const std::string KEY_CONFIG_FILENAME = "cfg.filename";
25const std::string KEY_CONFIG_LOG_LEVEL = "cfg.log.level";
26const std::string KEY_CONFIG_LOG_PROPERTIES = "cfg.log.properties";
27
28class Config;
29
30
34class 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 {{cookiecutter.module_name}}
90
91#endif // {{cookiecutter.module_name|upper}}_DB_INTERFACE_HPP_
DbAdapter class header file.
const std::string KEY_CONFIG_REQ_ENDPOINT
Definition dbInterface.hpp:23
const std::string KEY_CONFIG_FILENAME
Definition dbInterface.hpp:27
const std::string KEY_CONFIG_DB_ENDPOINT
Definition dbInterface.hpp:24
const std::string KEY_CONTROL_STATE
Definition dbInterface.hpp:18
const std::string KEY_CONFIG_DB_TIMEOUT_SEC
Definition dbInterface.hpp:25
const std::string KEY_CONFIG_SM_SCXML
Definition dbInterface.hpp:26
const std::string KEY_CONFIG_LOG_PROPERTIES
Definition dbInterface.hpp:29
const std::string KEY_CONFIG_LOG_LEVEL
Definition dbInterface.hpp:28
#define cookiecutter