ifw-fcf  3.0.0
Public Member Functions | List of all members
fcf::devmgr::common::DataContext Class Reference

#include <dataContext.hpp>

Public Member Functions

 DataContext (IConfig &config, rad::DbAdapter &db_adapter, boost::asio::io_service &ios, bool with_publisher=true)
 
virtual ~DataContext ()
 
void ReloadConfig ()
 
void UpdateDb ()
 
DbInterfaceGetDbInterface ()
 
IConfigGetConfig ()
 
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 ()
 
 DataContext (const DataContext &)=delete
 Disable copy constructor. More...
 
DataContextoperator= (const DataContext &)=delete
 Disable assignment operator. More...
 

Detailed Description

This class provide access to the application run-time data including the in-memory DB.

Constructor & Destructor Documentation

◆ DataContext() [1/2]

fcf::devmgr::common::DataContext::DataContext ( IConfig config,
rad::DbAdapter &  db_adapter,
boost::asio::io_service &  ios,
bool  with_publisher = 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.

Parameters
[in]configReference to the application configuration.
[in]db_adapterDB adapter object
[in]iosASIO IO service reference

◆ ~DataContext()

fcf::devmgr::common::DataContext::~DataContext ( )
virtual

Destructor

◆ DataContext() [2/2]

fcf::devmgr::common::DataContext::DataContext ( const DataContext )
delete

Disable copy constructor.

Member Function Documentation

◆ GetConfig()

IConfig & fcf::devmgr::common::DataContext::GetConfig ( )
Returns
A reference to the Config object.

◆ GetDbInterface()

DbInterface & fcf::devmgr::common::DataContext::GetDbInterface ( )
Returns
A reference to the DB interface object.

◆ GetSettingState()

bool fcf::devmgr::common::DataContext::GetSettingState ( )

◆ GetState()

short fcf::devmgr::common::DataContext::GetState ( )

◆ GetStateStr()

std::string fcf::devmgr::common::DataContext::GetStateStr ( )

◆ GetSubstate()

short fcf::devmgr::common::DataContext::GetSubstate ( )

◆ GetSubstateStr()

std::string fcf::devmgr::common::DataContext::GetSubstateStr ( )

◆ operator=()

DataContext& fcf::devmgr::common::DataContext::operator= ( const DataContext )
delete

Disable assignment operator.

◆ PublishStates()

void fcf::devmgr::common::DataContext::PublishStates ( )

◆ ReloadConfig()

void fcf::devmgr::common::DataContext::ReloadConfig ( )

Reload the configuration from file and reconnect to the in-memory DB.

◆ SetSettingState()

void fcf::devmgr::common::DataContext::SetSettingState ( bool  new_state)

◆ SetState() [1/2]

void fcf::devmgr::common::DataContext::SetState ( const short  state)

◆ SetState() [2/2]

void fcf::devmgr::common::DataContext::SetState ( const std::string  state)

◆ SetSubstate() [1/2]

void fcf::devmgr::common::DataContext::SetSubstate ( const short  state)

◆ SetSubstate() [2/2]

void fcf::devmgr::common::DataContext::SetSubstate ( const std::string  state)

◆ UpdateDb()

void fcf::devmgr::common::DataContext::UpdateDb ( )

Try to connect to the DB and update the application configuration.


The documentation for this class was generated from the following files: