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 HELLO_DATA_CONTEXT_HPP_
10 #define HELLO_DATA_CONTEXT_HPP_
11 
12 #include "config.hpp"
13 #include "dbInterface.hpp"
14 
15 namespace hello {
16 
21 class DataContext
22 {
23 public:
24  DataContext(Config& config, rad::DbAdapter& db_adapter);
25  virtual ~DataContext();
26 
27  void ReloadConfig();
28  void DbUpdate();
29 
30  DbInterface& GetDbInterface();
31 
32  DataContext(const DataContext&) = delete;
33  DataContext& operator= (const DataContext&) = delete;
34 
35 private:
36  Config& m_config; // can be created only after reading the cmd line
37  rad::DbAdapter& m_runtime_db;
38  DbInterface m_db_interface;
39 };
40 
41 } // namespace hello
42 
43 #endif // HELLO_DATA_CONTEXT_HPP_
void DbUpdate()
Definition: dataContext.cpp:54
DataContext & operator=(const DataContext &)=delete
Disable copy constructor.
Definition: dbAdapter.hpp:29
DataContext(Config &config, rad::DbAdapter &db_adapter)
Definition: dataContext.cpp:26
DbInterface class header file.
void ReloadConfig()
Definition: dataContext.cpp:44
Config class header file.
virtual ~DataContext()
Definition: dataContext.cpp:37
DbInterface & GetDbInterface()
Definition: dataContext.cpp:78