EMANE  1.2.1
EMANE::ConfigurationService Class Reference

#include <configurationservice.h>

Inheritance diagram for EMANE::ConfigurationService:
EMANE::Utils::Singleton< ConfigurationService >

Public Member Functions

void registerRunningStateMutable (BuildId buildId, RunningStateMutable *pRunningStateMutable)
 
void registerNumericAny (BuildId buildId, const std::string &sName, Any::Type type, const ConfigurationProperties &properties, const std::vector< Any > &values, const std::string &sUsage, const Any &minValue, const Any &maxValue, std::size_t minOccurs, std::size_t maxOccurs, const std::string &sRegexPattern)
 
void registerNonNumericAny (BuildId buildId, const std::string &sName, Any::Type type, const ConfigurationProperties &properties, const std::vector< Any > &values, const std::string &sUsage, std::size_t minOccurs, std::size_t maxOccurs, const std::string &sRegexPattern)
 
ConfigurationManifest getConfigurationManifest (BuildId buildId) const
 
std::vector< std::pair< std::string, std::vector< Any > > > queryConfiguration (BuildId buildId, const std::vector< std::string > &names={}) const
 
ConfigurationUpdate buildUpdates (BuildId buildId, const ConfigurationUpdateRequest &parameters)
 
void update (BuildId buildId, const ConfigurationUpdate &update)
 
void registerValidator (BuildId buildId, ConfigurationValidator validator)
 

Static Public Member Functions

static ConfigurationServiceinstance ()
 
static void destroy ()
 

Protected Member Functions

 ConfigurationService ()
 

Detailed Description

Definition at line 52 of file configurationservice.h.

Constructor & Destructor Documentation

◆ ConfigurationService()

EMANE::ConfigurationService::ConfigurationService ( )
protected

Definition at line 39 of file configurationservice.cc.

Member Function Documentation

◆ buildUpdates()

EMANE::ConfigurationUpdate EMANE::ConfigurationService::buildUpdates ( BuildId  buildId,
const ConfigurationUpdateRequest parameters 
)

Builds a ConfigurationUpdate for processing by a component. Local configuration cache is updated and future calls to getConfigurationInfos will reflect the latest values processed by buildUpdates. Cache update only occurs if the entire update request is successfully validated.

Parameters
buildIdBuild id of the component
parametersName string values pairs of requested configuration updates.
Returns
ConfigurationInfos container holding configuration information.
Exceptions
ConfigurationExceptionThrown when a configuration validation error occurs. Errors include values or instance counts out of range, incorrect data type, string to data type conversion errors and unregistered configuration targets.

Definition at line 232 of file configurationservice.cc.

◆ destroy()

static void EMANE::Utils::Singleton< ConfigurationService >::destroy ( )
inlinestaticinherited

Destroys the single instance of type T. Once destroyed it cannot be used or recreated. This is not a thread-safe method.

Definition at line 67 of file singleton.h.

◆ getConfigurationManifest()

EMANE::ConfigurationManifest EMANE::ConfigurationService::getConfigurationManifest ( BuildId  buildId) const

Gets the configuration information for all registered configuration items associated with a specified build id.

Parameters
buildIdBuild id of the component
Returns
ConfigurationInfos container holding configuration information.
Exceptions
ConfigurationExceptionThrown when an invalid buildId is specified.

Definition at line 160 of file configurationservice.cc.

◆ instance()

static ConfigurationService * EMANE::Utils::Singleton< ConfigurationService >::instance ( )
inlinestaticinherited

Provides thread-safe access to a single instance of type T. It does not provide thread-safety for T methods.

Returns
A pointer to T

Definition at line 56 of file singleton.h.

◆ queryConfiguration()

std::vector< std::pair< std::string, std::vector< EMANE::Any > > > EMANE::ConfigurationService::queryConfiguration ( BuildId  buildId,
const std::vector< std::string > &  names = {} 
) const

Gets the configuration parmeter value(s) for specified registered configuration items associated with a specified build id.

Parameters
buildIdBuild id of the component
namesNames of items of interest. Empty list will return all items.
Returns
configuration name values pairs
Exceptions
ConfigurationExceptionThrown when an invalid buildId is specified or an unknown configuration parameter is requested.

Definition at line 182 of file configurationservice.cc.

◆ registerNonNumericAny()

void EMANE::ConfigurationService::registerNonNumericAny ( BuildId  buildId,
const std::string &  sName,
Any::Type  type,
const ConfigurationProperties properties,
const std::vector< Any > &  values,
const std::string &  sUsage,
std::size_t  minOccurs,
std::size_t  maxOccurs,
const std::string &  sRegexPattern 
)

Registers a non-numeric configuration item using an Any.

Parameters
buildIdBuild id of the registering component
sNameName of the configuration item to be registered
typeUnderlying Any type
propertiesConfiguration properties mask
valuesDefault configuration values
sUsageParameter usage description
minOccursMinimum values allowed
maxOccursMaximum values allowed
sRegexPatternRegular expression to match against
Exceptions
ConfigurationExceptionThrow when a registration error occurs.

Definition at line 75 of file configurationservice.cc.

◆ registerNumericAny()

void EMANE::ConfigurationService::registerNumericAny ( BuildId  buildId,
const std::string &  sName,
Any::Type  type,
const ConfigurationProperties properties,
const std::vector< Any > &  values,
const std::string &  sUsage,
const Any minValue,
const Any maxValue,
std::size_t  minOccurs,
std::size_t  maxOccurs,
const std::string &  sRegexPattern 
)

Registers a numeric configuration item using an Any.

Parameters
buildIdBuild id of the registering component
sNameName of the configuration item to be registered
typeUnderlying Any type
propertiesConfiguration properties mask
valuesDefault configuration values
sUsageParameter usage description
minValueMinimum acceptable value
maxValueMaximum acceptable value
minOccursMinimum values allowed
maxOccursMaximum values allowed
sRegexPatternRegular expression to match against
Exceptions
ConfigurationExceptionThrow when a registration error occurs.

Definition at line 49 of file configurationservice.cc.

◆ registerRunningStateMutable()

void EMANE::ConfigurationService::registerRunningStateMutable ( BuildId  buildId,
RunningStateMutable pRunningStateMutable 
)

Definition at line 41 of file configurationservice.cc.

◆ registerValidator()

void EMANE::ConfigurationService::registerValidator ( BuildId  buildId,
ConfigurationValidator  validator 
)

Definition at line 601 of file configurationservice.cc.

◆ update()

void EMANE::ConfigurationService::update ( BuildId  buildId,
const ConfigurationUpdate update 
)

Definition at line 423 of file configurationservice.cc.


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