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

#include <config.hpp>

Inheritance diagram for 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
 
ReplyConfigDataGetCmdReplyData (const std::string &name)
 
virtual void GetConfigList (DbVector &cfg_list) override
 Get configuration list. More...
 
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
 
Configoperator= (const Config &)=delete
 Disable copy constructor. More...
 

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]

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

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

Default destructor.

◆ Config() [2/2]

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

Member Function Documentation

◆ GetCmdReplyData()

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

◆ GetCommandName()

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

◆ GetConfigList()

void 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 sup::subsim::common::Config::GetNumCommands ( )

◆ GetReplyDelay()

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

◆ GetReplyErrorMessage()

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

◆ GetReplyOk()

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

◆ LoadConfig()

void 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& sup::subsim::common::Config::operator= ( const Config )
delete

Disable copy constructor.

◆ SetReplyDelay()

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

◆ SetReplyErrorMessage()

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

◆ SetReplyOk()

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

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