ifw-sup
3.0.0-pre3
|
#include <dataContext.hpp>
Public Member Functions | |
DataContext (Config &config, bool with_publisher=true, bool with_oldb=true) | |
virtual | ~DataContext () |
void | ReloadConfig () |
void | UpdateDb () |
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 | PublishStates () |
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.
sup::subsim::common::DataContext::DataContext | ( | Config & | config, |
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.
short sup::subsim::common::DataContext::GetState | ( | ) |
std::string sup::subsim::common::DataContext::GetStateStr | ( | ) |
short sup::subsim::common::DataContext::GetSubstate | ( | ) |
std::string sup::subsim::common::DataContext::GetSubstateStr | ( | ) |
|
delete |
Disable assignment operator.
void sup::subsim::common::DataContext::PublishStates | ( | ) |
void sup::subsim::common::DataContext::ReloadConfig | ( | ) |
Reload the configuration from file and reconnect to the in-memory DB.
void sup::subsim::common::DataContext::SetState | ( | const short | state | ) |
void sup::subsim::common::DataContext::SetState | ( | const std::string | state | ) |
void sup::subsim::common::DataContext::SetSubstate | ( | const short | state | ) |
void sup::subsim::common::DataContext::SetSubstate | ( | const std::string | state | ) |
void sup::subsim::common::DataContext::UpdateDb | ( | ) |
Try to connect to the DB and update the application configuration.