ifw-sup
3.0.0-pre3
|
#include <config.hpp>
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< ScopeEnum > | GetSubsysScope (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... | |
This class provide access to the command line options and the configuration parameters stored in the configuration file.
sup::syssup::common::Config::Config | ( | ) |
Default constructor.
Initialize application configuration attributes by
|
virtual |
Default destructor.
|
overridevirtual |
Get configuration list.
cfg_list | List 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.
int sup::syssup::common::Config::GetNumObModes | ( | ) | const |
int sup::syssup::common::Config::GetNumOpModes | ( | ) | const |
The number of defined operational modes.
int sup::syssup::common::Config::GetNumSubsystems | ( | ) | const |
std::optional< std::vector< std::string > > sup::syssup::common::Config::GetObSubsystems | ( | const std::string & | mode | ) | const |
bool sup::syssup::common::Config::GetSubsysAccess | ( | const std::string & | name | ) |
GetSubsysAccess.
name | Name of the subsystem |
const std::string sup::syssup::common::Config::GetSubsysName | ( | const int & | subsys_index | ) |
Returns a given subsystem name.
subsys_index | Index of the subsystem in the array. |
const std::string sup::syssup::common::Config::GetSubsysPsEndpoint | ( | const std::string & | name | ) |
Returs subsystem pub/sub endpoint.
name | Name of the subsystem |
const std::string sup::syssup::common::Config::GetSubsysRrEndpoint | ( | const std::string & | name | ) |
Returs subsystem req/reply endpoint.
name | Name of the subsystem |
std::optional< ScopeEnum > sup::syssup::common::Config::GetSubsysScope | ( | const std::string & | name | ) |
GetSubsysScope.
name | Name of the subsystem |
std::string sup::syssup::common::Config::GetSubsysScopeStr | ( | const std::string & | name | ) |
GetSubsysScopeStr.
name |
const std::string sup::syssup::common::Config::GetSubsysType | ( | const std::string & | name | ) |
Returs subsystem type.
name | Name of the subsystem |
|
override |
This method load from a configuration file the application configuration overriding the initialization done in the constructor and the command line options.
[in] | filename | Application configuration filename. |
[in] | reset | Resets the internal configuration. |
void sup::syssup::common::Config::SetSubsysAccess | ( | const std::string & | name, |
const bool & | access | ||
) |