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

#include <config.hpp>

Inheritance diagram for sup::syssup::common::Config:

Public Member Functions

 Config ()
 
virtual ~Config ()
 
void LoadConfig (const std::string &filename="", bool reset=false) override
 
int GetNumSubsystems () const
 
int GetNumOpModes () const
 The number of defined operational modes. More...
 
int GetNumObModes () const
 
const std::string GetSubsysName (const int &subsys_index)
 Returns a given subsystem name. More...
 
const std::string GetSubsysRrEndpoint (const std::string &name)
 Returs subsystem req/reply endpoint. More...
 
const std::string GetSubsysPsEndpoint (const std::string &name)
 Returs subsystem pub/sub endpoint. More...
 
const std::string GetSubsysType (const std::string &name)
 Returs subsystem type. More...
 
std::optional< ScopeEnumGetSubsysScope (const std::string &name)
 GetSubsysScope. More...
 
std::string GetSubsysScopeStr (const std::string &name)
 GetSubsysScopeStr. More...
 
bool GetSubsysAccess (const std::string &name)
 GetSubsysAccess. More...
 
void SetSubsysAccess (const std::string &name, const bool &access)
 
std::optional< std::vector< std::string > > GetObSubsystems (const std::string &mode) const
 
virtual void GetConfigList (utils::bat::DbVector &cfg_list) override
 Get configuration list. 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()

sup::syssup::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::syssup::common::Config::~Config ( )
virtual

Default destructor.

Member Function Documentation

◆ GetConfigList()

void sup::syssup::common::Config::GetConfigList ( utils::bat::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.

◆ GetNumObModes()

int sup::syssup::common::Config::GetNumObModes ( ) const

◆ GetNumOpModes()

int sup::syssup::common::Config::GetNumOpModes ( ) const

The number of defined operational modes.

Returns

◆ GetNumSubsystems()

int sup::syssup::common::Config::GetNumSubsystems ( ) const
Returns
The number of configured subsystems

◆ GetObSubsystems()

std::optional< std::vector< std::string > > sup::syssup::common::Config::GetObSubsystems ( const std::string &  mode) const

◆ GetSubsysAccess()

bool sup::syssup::common::Config::GetSubsysAccess ( const std::string &  name)

GetSubsysAccess.

Parameters
nameName of the subsystem
Returns

◆ GetSubsysName()

const std::string sup::syssup::common::Config::GetSubsysName ( const int &  subsys_index)

Returns a given subsystem name.

Parameters
subsys_indexIndex of the subsystem in the array.
Returns

◆ GetSubsysPsEndpoint()

const std::string sup::syssup::common::Config::GetSubsysPsEndpoint ( const std::string &  name)

Returs subsystem pub/sub endpoint.

Parameters
nameName of the subsystem
Returns

◆ GetSubsysRrEndpoint()

const std::string sup::syssup::common::Config::GetSubsysRrEndpoint ( const std::string &  name)

Returs subsystem req/reply endpoint.

Parameters
nameName of the subsystem
Returns

◆ GetSubsysScope()

std::optional< ScopeEnum > sup::syssup::common::Config::GetSubsysScope ( const std::string &  name)

GetSubsysScope.

Parameters
nameName of the subsystem
Returns

◆ GetSubsysScopeStr()

std::string sup::syssup::common::Config::GetSubsysScopeStr ( const std::string &  name)

GetSubsysScopeStr.

Parameters
name
Returns

◆ GetSubsysType()

const std::string sup::syssup::common::Config::GetSubsysType ( const std::string &  name)

Returs subsystem type.

Parameters
nameName of the subsystem
Returns

◆ LoadConfig()

void sup::syssup::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.

◆ SetSubsysAccess()

void sup::syssup::common::Config::SetSubsysAccess ( const std::string &  name,
const bool &  access 
)

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