rad 6.2.0
Loading...
Searching...
No Matches
dbInterface.hpp
Go to the documentation of this file.
1
9#ifndef SERVER_DB_INTERFACE_HPP_
10#define SERVER_DB_INTERFACE_HPP_
11
12#include <rad/dbAdapter.hpp>
13
14#include <string>
15
16namespace server {
17
18const std::string KEY_CONTROL_STATE = "ctr.state";
19const std::string KEY_CONTROL_SUBSTATE = "ctr.substate";
20const std::string KEY_CONTROL_STATUS = "ctr.status";
21const std::string KEY_CONTROL_SIMULATION = "ctr.simulation";
22
23const std::string KEY_CONFIG_REQ_ENDPOINT = "cfg.req.endpoint";
24const std::string KEY_CONFIG_SUB_ENDPOINT = "cfg.sub.endpoint";
25const std::string KEY_CONFIG_DB_ENDPOINT = "cfg.db.endpoint";
26const std::string KEY_CONFIG_DB_TIMEOUT_SEC = "cfg.db.timeout.sec";
27const std::string KEY_CONFIG_SM_SCXML = "cfg.sm.scxml";
28const std::string KEY_CONFIG_SM_SCXML_APPEND = "cfg.sm.scxml_append";
29const std::string KEY_CONFIG_FILENAME = "cfg.filename";
30const std::string KEY_CONFIG_LOG_LEVEL = "cfg.log.level";
31const std::string KEY_CONFIG_LOG_PROPERTIES = "cfg.log.properties";
32
33const std::string KEY_DATA_DEVMEAS_X = "dat.meas.x";
34const std::string KEY_DATA_DEVMEAS_Y = "dat.meas.y";
35const std::string KEY_DATA_DEVMEAS_TIME = "dat.meas.time";
36
37class Config;
38
43 public:
44 DbInterface(const std::string& prefix, rad::DbAdapter& runtime_db);
45 virtual ~DbInterface();
46
47 std::string GetControlState();
48 std::string GetControlSubstate();
49 std::string GetControlStatus();
50 std::string Get(const std::string& key);
51
52 void SetControlState(const std::string& value);
53 void SetControlSubstate(const std::string& value);
54 void SetControlStatus(const std::string& value);
55 void SetControl(const std::string& state, const std::string& substate,
56 const std::string& status);
57
58 void SetConfig(const Config& cfg);
59
60 void SetDataDevMeas(const std::string& time_stamp, const double x, const double y);
61
62 void Set(const std::string& key, const std::string& value);
63
64 DbInterface(const DbInterface&) = delete;
65 DbInterface& operator=(const DbInterface&) = delete;
66
67 private:
68 std::string m_prefix;
69 rad::DbAdapter& m_runtime_db;
70};
71
72} // namespace server
73
74#endif // SERVER_DB_INTERFACE_HPP_
Definition dbAdapter.hpp:24
Definition config.hpp:45
Definition dbInterface.hpp:42
void SetDataDevMeas(const std::string &time_stamp, const double x, const double y)
Definition dbInterface.cpp:151
void Set(const std::string &key, const std::string &value)
Definition dbInterface.cpp:169
void SetControlState(const std::string &value)
Definition dbInterface.cpp:75
std::string GetControlState()
Definition dbInterface.cpp:42
DbInterface(const std::string &prefix, rad::DbAdapter &runtime_db)
Definition dbInterface.cpp:25
void SetControl(const std::string &state, const std::string &substate, const std::string &status)
Definition dbInterface.cpp:103
std::string GetControlStatus()
Definition dbInterface.cpp:58
std::string Get(const std::string &key)
Definition dbInterface.cpp:67
virtual ~DbInterface()
Definition dbInterface.cpp:37
void SetConfig(const Config &cfg)
Definition dbInterface.cpp:123
DbInterface(const DbInterface &)=delete
void SetControlSubstate(const std::string &value)
Definition dbInterface.cpp:83
std::string GetControlSubstate()
Definition dbInterface.cpp:50
void SetControlStatus(const std::string &value)
Definition dbInterface.cpp:91
DbInterface & operator=(const DbInterface &)=delete
Disable copy constructor.
DbAdapter class header file.
Definition actionMgr.cpp:25
const std::string KEY_CONFIG_DB_ENDPOINT
Definition dbInterface.hpp:25
const std::string KEY_CONFIG_LOG_LEVEL
Definition dbInterface.hpp:30
const std::string KEY_CONFIG_SM_SCXML
Definition dbInterface.hpp:27
const std::string KEY_CONFIG_REQ_ENDPOINT
Definition dbInterface.hpp:23
const std::string KEY_CONFIG_SM_SCXML_APPEND
Definition dbInterface.hpp:28
const std::string KEY_DATA_DEVMEAS_Y
Definition dbInterface.hpp:34
const std::string KEY_CONTROL_STATUS
Definition dbInterface.hpp:20
const std::string KEY_CONFIG_SUB_ENDPOINT
Definition dbInterface.hpp:24
const std::string KEY_CONTROL_STATE
Definition dbInterface.hpp:18
const std::string KEY_DATA_DEVMEAS_TIME
Definition dbInterface.hpp:35
const std::string KEY_CONTROL_SIMULATION
Definition dbInterface.hpp:21
const std::string KEY_CONFIG_FILENAME
Definition dbInterface.hpp:29
const std::string KEY_DATA_DEVMEAS_X
Definition dbInterface.hpp:33
const std::string KEY_CONFIG_DB_TIMEOUT_SEC
Definition dbInterface.hpp:26
const std::string KEY_CONFIG_LOG_PROPERTIES
Definition dbInterface.hpp:31
const std::string KEY_CONTROL_SUBSTATE
Definition dbInterface.hpp:19