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

#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)
 
ConfigGetConfig ()
 
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...
 
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 ( 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.

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()

Config & fcf::devmgr::common::DataContext::GetConfig ( )
Returns
A reference to the Config 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.

◆ SetAsync()

template<typename T >
void fcf::devmgr::common::DataContext::SetAsync ( const std::string &  key,
const T &  value 
)

◆ 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() [1/2]

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

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

◆ UpdateDb() [2/2]

void fcf::devmgr::common::DataContext::UpdateDb ( utils::bat::DbVector &  vec)

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