rad  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dataContext.hpp
Go to the documentation of this file.
1 
9 #ifndef SERVER_DATA_CONTEXT_HPP_
10 #define SERVER_DATA_CONTEXT_HPP_
11 
12 #include "config.hpp"
13 #include "dbInterface.hpp"
14 
15 namespace server {
16 
21 class DataContext {
22  public:
23  DataContext(Config& config, rad::DbAdapter& db_adapter);
24  virtual ~DataContext();
25 
26  void ReloadConfig();
27  void DbUpdate();
28 
29  DbInterface& GetDbInterface();
30 
31  void GetTargetPos(double& x, double& y);
32  void SetTargetPos(const double x, const double y);
33 
34  DataContext(const DataContext&) = delete;
35  DataContext& operator=(const DataContext&) = delete;
36 
37  private:
38  Config& m_config; // can be created only after reading the cmd line
39  rad::DbAdapter& m_runtime_db;
40  DbInterface m_db_interface;
41  double m_x;
42  double m_y;
43 };
44 
45 } // namespace server
46 
47 #endif // SERVER_DATA_CONTEXT_HPP_
float y
Definition: topics.proto:7
DbInterface & GetDbInterface()
Definition: dataContext.cpp:79
Config class header file.
Definition: dbAdapter.hpp:29
void ReloadConfig()
Definition: dataContext.cpp:45
def server
Server receiving requests and publishing topics.
Definition: hellorad.py:108
virtual ~DataContext()
Definition: dataContext.cpp:40
void DbUpdate()
Definition: dataContext.cpp:55
DataContext(Config &config, rad::DbAdapter &db_adapter)
Definition: dataContext.cpp:27
void GetTargetPos(double &x, double &y)
Definition: dataContext.cpp:87
DbInterface class header file.
DataContext & operator=(const DataContext &)=delete
Disable copy constructor.
void SetTargetPos(const double x, const double y)
Definition: dataContext.cpp:96