|
ifw-fcf
5.0.0
|
#include <dataContext.hpp>
Public Member Functions | |
| DataContext (Config &config, boost::asio::io_service &ios, bool with_publisher=true, bool with_oldb=true) | |
| virtual | ~DataContext () |
| void | ReloadConfig () |
| void | UpdateDb () |
| void | UpdateDb (utils::bat::DbVector &vec) |
| Config & | GetConfig () |
| short | GetState () |
| std::string | GetStateStr () |
| void | SetState (const short state) |
| void | SetState (const std::string state) |
| short | GetSubstate () |
| std::string | GetSubstateStr () |
| void | SetSubstate (const short state) |
| void | SetSubstate (const std::string state) |
| void | SetSettingState (bool new_state) |
| bool | GetSettingState () |
| void | PublishStates () |
| template<typename T > | |
| void | SetAsync (const std::string &key, const T &value) |
| DataContext (const DataContext &)=delete | |
| Disable copy constructor. More... | |
| DataContext & | operator= (const DataContext &)=delete |
| Disable assignment operator. More... | |
This class provide access to the application run-time data including the in-memory DB.
| fcf::devmgr::common::DataContext::DataContext | ( | Config & | config, |
| boost::asio::io_service & | ios, | ||
| bool | with_publisher = true, |
||
| bool | with_oldb = true |
||
| ) |
This constructor uses the application configuration to initialize the adapter object to the in-memory DB. The DB adapter is then used to initialize the DB interface object that can be used to access the DB key-value pairs.
| [in] | config | Reference to the application configuration. |
| [in] | db_adapter | DB adapter object |
| [in] | ios | ASIO IO service reference |
|
virtual |
Destructor
|
delete |
Disable copy constructor.
| bool fcf::devmgr::common::DataContext::GetSettingState | ( | ) |
| short fcf::devmgr::common::DataContext::GetState | ( | ) |
| std::string fcf::devmgr::common::DataContext::GetStateStr | ( | ) |
| short fcf::devmgr::common::DataContext::GetSubstate | ( | ) |
| std::string fcf::devmgr::common::DataContext::GetSubstateStr | ( | ) |
|
delete |
Disable assignment operator.
| void fcf::devmgr::common::DataContext::PublishStates | ( | ) |
| void fcf::devmgr::common::DataContext::ReloadConfig | ( | ) |
Reload the configuration from file and reconnect to the in-memory DB.
| void fcf::devmgr::common::DataContext::SetAsync | ( | const std::string & | key, |
| const T & | value | ||
| ) |
| void fcf::devmgr::common::DataContext::SetSettingState | ( | bool | new_state | ) |
| void fcf::devmgr::common::DataContext::SetState | ( | const short | state | ) |
| void fcf::devmgr::common::DataContext::SetState | ( | const std::string | state | ) |
| void fcf::devmgr::common::DataContext::SetSubstate | ( | const short | state | ) |
| void fcf::devmgr::common::DataContext::SetSubstate | ( | const std::string | state | ) |
| void fcf::devmgr::common::DataContext::UpdateDb | ( | ) |
Try to connect to the DB and update the application configuration.
| void fcf::devmgr::common::DataContext::UpdateDb | ( | utils::bat::DbVector & | vec | ) |