rad  4.0.0
oldbInterface.hpp
Go to the documentation of this file.
1 
9 #ifndef EXCIISERVER_OLDB_INTERFACE_HPP
10 #define EXCIISERVER_OLDB_INTERFACE_HPP
11 
12 #include <rad/cii/oldbAdapter.hpp>
13 
14 #include <string_view>
15 #include <vector>
16 
17 namespace exciiserver {
18 
19 /*
20  * Configuration OLDB Attributes.
21  * Note that CII OLDB convert all keys to lowercase.
22  */
23 const std::string KEY_CONFIG_VERSION = "cfg/version";
24 const std::string KEY_CONFIG_PROCNAME = "cfg/procname";
25 const std::string KEY_CONFIG_FILENAME = "cfg/filename";
26 const std::string KEY_CONFIG_LOG_LEVEL = "cfg/log/level";
27 const std::string KEY_CONFIG_LOG_PROPERTIES = "cfg/log/properties";
28 const std::string KEY_CONFIG_SM_SCXML = "cfg/sm/scxml";
29 const std::string KEY_CONFIG_REQ_ENDPOINT = "cfg/req/endpoint";
30 const std::string KEY_CONFIG_OLDB_URI_PREFIX = "cfg/oldb/uri_prefix";
31 const std::string KEY_CONFIG_OLDB_CONN_TIMEOUT = "cfg/oldb/conn_timeout";
32 
33 const std::vector<std::string> KEYS_CONFIG = {
42  //KEY_CONFIG_OLDB_CONN_TIMEOUT this is not a string attribute -> special case
43 };
44 
45 /*
46  * Monitor OLDB Attributes.
47  */
48 const std::string KEY_MON_STATE = "mon/state";
49 const std::string KEY_MON_TARGET_RA = "mon/target/ra";
50 const std::string KEY_MON_TARGET_DEC = "mon/target/dec";
51 const std::string KEY_MON_ACTUAL_RA = "mon/actual/ra";
52 const std::string KEY_MON_ACTUAL_DEC = "mon/actual/dec";
53 
54 class Config;
55 
60  public:
66  OldbInterface(const std::string& prefix, rad::cii::OldbAdapter& oldb);
67 
71  virtual ~OldbInterface();
72 
73  inline const std::string& GetPrefix() { return m_prefix; }
74  inline rad::cii::OldbAdapter& GetOldbAdapter() { return m_oldb; }
75 
76  inline void SetPrefix(const std::string& prefix) { m_prefix = prefix; }
77  void SetConfig(Config& cfg);
78  void SetControlState(const std::string& value);
79  void GetControlState(std::string& value);
80  void SetTargetRaDec(const float ra, const float dec);
81  void SetActualRaDec(const float ra, const float dec);
82 
83  OldbInterface(const OldbInterface&) = delete;
85 
86  private:
87  std::string m_prefix;
88  rad::cii::OldbAdapter& m_oldb;
89 };
90 
91 } // namespace exciiserver
92 
93 #endif // EXCIISERVER_OLDB_INTERFACE_HPP
exciiserver::KEY_CONFIG_FILENAME
const std::string KEY_CONFIG_FILENAME
Definition: oldbInterface.hpp:25
exciiserver::KEY_CONFIG_SM_SCXML
const std::string KEY_CONFIG_SM_SCXML
Definition: oldbInterface.hpp:28
exciiserver::OldbInterface
Definition: oldbInterface.hpp:59
exciiserver::OldbInterface::SetActualRaDec
void SetActualRaDec(const float ra, const float dec)
Definition: oldbInterface.cpp:62
exciiserver::OldbInterface::GetPrefix
const std::string & GetPrefix()
Definition: oldbInterface.hpp:73
exciiserver::KEY_CONFIG_REQ_ENDPOINT
const std::string KEY_CONFIG_REQ_ENDPOINT
Definition: oldbInterface.hpp:29
exciiserver::KEY_MON_ACTUAL_RA
const std::string KEY_MON_ACTUAL_RA
Definition: oldbInterface.hpp:51
exciiserver::OldbInterface::OldbInterface
OldbInterface(const std::string &prefix, rad::cii::OldbAdapter &oldb)
Definition: oldbInterface.cpp:21
exciiserver::KEYS_CONFIG
const std::vector< std::string > KEYS_CONFIG
Definition: oldbInterface.hpp:33
exciiserver::KEY_MON_TARGET_DEC
const std::string KEY_MON_TARGET_DEC
Definition: oldbInterface.hpp:50
exciiserver::KEY_MON_ACTUAL_DEC
const std::string KEY_MON_ACTUAL_DEC
Definition: oldbInterface.hpp:52
exciiserver::KEY_CONFIG_OLDB_CONN_TIMEOUT
const std::string KEY_CONFIG_OLDB_CONN_TIMEOUT
Definition: oldbInterface.hpp:31
exciiserver::Config
Definition: config.hpp:48
exciiserver::OldbInterface::SetTargetRaDec
void SetTargetRaDec(const float ra, const float dec)
Definition: oldbInterface.cpp:56
exciiserver::KEY_CONFIG_LOG_LEVEL
const std::string KEY_CONFIG_LOG_LEVEL
Definition: oldbInterface.hpp:26
exciiserver::OldbInterface::operator=
OldbInterface & operator=(const OldbInterface &)=delete
Disable copy constructor.
exciiserver::KEY_CONFIG_VERSION
const std::string KEY_CONFIG_VERSION
Definition: oldbInterface.hpp:23
exciiserver
Definition: actionMgr.cpp:23
exciiserver::OldbInterface::SetPrefix
void SetPrefix(const std::string &prefix)
Definition: oldbInterface.hpp:76
exciiserver::KEY_MON_STATE
const std::string KEY_MON_STATE
Definition: oldbInterface.hpp:48
exciiserver::KEY_CONFIG_PROCNAME
const std::string KEY_CONFIG_PROCNAME
Definition: oldbInterface.hpp:24
rad::cii::OldbAdapter
Definition: oldbAdapter.hpp:44
exciiserver::OldbInterface::GetOldbAdapter
rad::cii::OldbAdapter & GetOldbAdapter()
Definition: oldbInterface.hpp:74
exciiserver::KEY_CONFIG_OLDB_URI_PREFIX
const std::string KEY_CONFIG_OLDB_URI_PREFIX
Definition: oldbInterface.hpp:30
exciiserver::KEY_MON_TARGET_RA
const std::string KEY_MON_TARGET_RA
Definition: oldbInterface.hpp:49
exciiserver::OldbInterface::GetControlState
void GetControlState(std::string &value)
Definition: oldbInterface.cpp:51
exciiserver::OldbInterface::SetConfig
void SetConfig(Config &cfg)
Definition: oldbInterface.cpp:34
exciiserver::OldbInterface::~OldbInterface
virtual ~OldbInterface()
Definition: oldbInterface.cpp:30
exciiserver::OldbInterface::OldbInterface
OldbInterface(const OldbInterface &)=delete
oldbAdapter.hpp
OldbAdapter interface file.
exciiserver::OldbInterface::SetControlState
void SetControlState(const std::string &value)
Definition: oldbInterface.cpp:46
exciiserver::KEY_CONFIG_LOG_PROPERTIES
const std::string KEY_CONFIG_LOG_PROPERTIES
Definition: oldbInterface.hpp:27