ifw-sup 5.1.0
 
Loading...
Searching...
No Matches
ifw::sup::subsim::common::Config Class Reference

#include <config.hpp>

Inheritance diagram for ifw::sup::subsim::common::Config:

Public Member Functions

 Config ()
 
virtual ~Config ()
 
void LoadConfig (const std::string &filename="", bool reset=false) override
 
std::optional< bool > GetReplyOk (const std::string &name) const
 
std::optional< int > GetReplyDelay (const std::string &name) const
 
std::optional< std::string > GetReplyErrorMessage (const std::string &name) const
 
ReplyConfigData * GetCmdReplyData (const std::string &name)
 
virtual void GetConfigList (DbVector &cfg_list) override
 Get configuration list.
 
const int GetNumCommands ()
 
const std::string GetCommandName (const int &cmd_index)
 
void SetReplyOk (const std::string &name, const bool &flag)
 
void SetReplyDelay (const std::string &name, const int &delay)
 
void SetReplyErrorMessage (const std::string &name, const std::string &msg)
 
 Config (const Config &)=delete
 
Config & operator= (const Config &)=delete
 Disable copy constructor.
 

Detailed Description

This class provide access to the command line options and the configuration parameters stored in the configuration file.

Constructor & Destructor Documentation

◆ Config() [1/2]

ifw::sup::subsim::common::Config::Config ( )

Default constructor.

Initialize application configuration attributes by

  • first use the default constant values defined in the header
  • override the constant values with environment variables (if defined)

◆ ~Config()

ifw::sup::subsim::common::Config::~Config ( )
virtual

Default destructor.

◆ Config() [2/2]

ifw::sup::subsim::common::Config::Config ( const Config & )
delete

Member Function Documentation

◆ GetCmdReplyData()

ReplyConfigData * ifw::sup::subsim::common::Config::GetCmdReplyData ( const std::string & name)

◆ GetCommandName()

const std::string ifw::sup::subsim::common::Config::GetCommandName ( const int & cmd_index)

◆ GetConfigList()

void ifw::sup::subsim::common::Config::GetConfigList ( DbVector & cfg_list)
overridevirtual

Get configuration list.

Parameters
cfg_listList of all configuration parameters.

This method returs the complete of configuration parameters handled by this class. This method is used to dump the list into the DB.

◆ GetNumCommands()

const int ifw::sup::subsim::common::Config::GetNumCommands ( )

◆ GetReplyDelay()

std::optional< int > ifw::sup::subsim::common::Config::GetReplyDelay ( const std::string & name) const

◆ GetReplyErrorMessage()

std::optional< std::string > ifw::sup::subsim::common::Config::GetReplyErrorMessage ( const std::string & name) const

◆ GetReplyOk()

std::optional< bool > ifw::sup::subsim::common::Config::GetReplyOk ( const std::string & name) const

◆ LoadConfig()

void ifw::sup::subsim::common::Config::LoadConfig ( const std::string & filename = "",
bool reset = false )
override

This method load from a configuration file the application configuration overriding the initialization done in the constructor and the command line options.

Parameters
[in]filenameApplication configuration filename.
[in]resetResets the internal configuration.

◆ operator=()

Config & ifw::sup::subsim::common::Config::operator= ( const Config & )
delete

Disable copy constructor.

◆ SetReplyDelay()

void ifw::sup::subsim::common::Config::SetReplyDelay ( const std::string & name,
const int & delay )

◆ SetReplyErrorMessage()

void ifw::sup::subsim::common::Config::SetReplyErrorMessage ( const std::string & name,
const std::string & msg )

◆ SetReplyOk()

void ifw::sup::subsim::common::Config::SetReplyOk ( const std::string & name,
const bool & flag )

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