ifw-sup  3.0.0-pre3
Public Member Functions | List of all members
sup::subsim::common::DataContext Class Reference

#include <dataContext.hpp>

Public Member Functions

 DataContext (Config &config, bool with_publisher=true, bool with_oldb=true)
 
virtual ~DataContext ()
 
void ReloadConfig ()
 
void UpdateDb ()
 
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 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]

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.

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

◆ ~DataContext()

sup::subsim::common::DataContext::~DataContext ( )
virtual

Destructor

◆ DataContext() [2/2]

sup::subsim::common::DataContext::DataContext ( const DataContext )
delete

Disable copy constructor.

Member Function Documentation

◆ GetConfig()

Config & sup::subsim::common::DataContext::GetConfig ( )
Returns
A reference to the Config object.

◆ GetState()

short sup::subsim::common::DataContext::GetState ( )

◆ GetStateStr()

std::string sup::subsim::common::DataContext::GetStateStr ( )

◆ GetSubstate()

short sup::subsim::common::DataContext::GetSubstate ( )

◆ GetSubstateStr()

std::string sup::subsim::common::DataContext::GetSubstateStr ( )

◆ operator=()

DataContext& sup::subsim::common::DataContext::operator= ( const DataContext )
delete

Disable assignment operator.

◆ PublishStates()

void sup::subsim::common::DataContext::PublishStates ( )

◆ ReloadConfig()

void sup::subsim::common::DataContext::ReloadConfig ( )

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

◆ SetState() [1/2]

void sup::subsim::common::DataContext::SetState ( const short  state)

◆ SetState() [2/2]

void sup::subsim::common::DataContext::SetState ( const std::string  state)

◆ SetSubstate() [1/2]

void sup::subsim::common::DataContext::SetSubstate ( const short  state)

◆ SetSubstate() [2/2]

void sup::subsim::common::DataContext::SetSubstate ( const std::string  state)

◆ UpdateDb()

void sup::subsim::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: