EMANE  1.2.1
EMANE::ConfigurationRegistrar Class Referenceabstract

The ConfigurationRegistrar allows NEM layers to register the configuration items they require. More...

#include <configurationregistrar.h>

Inheritance diagram for EMANE::ConfigurationRegistrar:
EMANE::ConfigurationRegistrarProxy

Public Member Functions

virtual ~ConfigurationRegistrar ()
 
template<typename T >
void registerNumeric (const std::string &sName, const ConfigurationProperties &properties=ConfigurationProperties::NONE, const std::initializer_list< T > &values={}, const std::string &sUsage="", T minValue=std::numeric_limits< T >::lowest(), T maxValue=std::numeric_limits< T >::max(), std::size_t minOccurs=1, std::size_t maxOccurs=1, const std::string &sRegexPattern={})
 
template<typename T >
void registerNonNumeric (const std::string &sName, const ConfigurationProperties &properties=ConfigurationProperties::NONE, const std::initializer_list< T > &values={}, const std::string &sUsage="", std::size_t minOccurs=1, std::size_t maxOccurs=1, const std::string &sRegexPattern={})
 
virtual void registerValidator (ConfigurationValidator validator)=0
 

Protected Member Functions

 ConfigurationRegistrar ()
 
virtual void registerNumericAny (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={})=0
 
virtual void registerNonNumericAny (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={})=0
 

Detailed Description

The ConfigurationRegistrar allows NEM layers to register the configuration items they require.

Note
Registration may only occur during Component::initialize()

Definition at line 56 of file configurationregistrar.h.

Constructor & Destructor Documentation

◆ ~ConfigurationRegistrar()

EMANE::ConfigurationRegistrar::~ConfigurationRegistrar ( )
inlinevirtual

Destroys an instance

Definition at line 39 of file configurationregistrar.inl.

◆ ConfigurationRegistrar()

EMANE::ConfigurationRegistrar::ConfigurationRegistrar ( )
inlineprotected

Definition at line 36 of file configurationregistrar.inl.

Member Function Documentation

◆ registerNonNumeric()

template<typename T >
void EMANE::ConfigurationRegistrar::registerNonNumeric ( const std::string &  sName,
const ConfigurationProperties properties = ConfigurationProperties::NONE,
const std::initializer_list< T > &  values = {},
const std::string &  sUsage = "",
std::size_t  minOccurs = 1,
std::size_t  maxOccurs = 1,
const std::string &  sRegexPattern = {} 
)

Registers a non-numeric configuration item

Parameters
sNameName of the configuration item to be registered
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 68 of file configurationregistrar.inl.

◆ registerNonNumericAny()

virtual void EMANE::ConfigurationRegistrar::registerNonNumericAny ( 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 = {} 
)
protectedpure virtual

Registers a non-numeric configuration item using an Any.

Parameters
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.

◆ registerNumeric()

template<typename T >
void EMANE::ConfigurationRegistrar::registerNumeric ( const std::string &  sName,
const ConfigurationProperties properties = ConfigurationProperties::NONE,
const std::initializer_list< T > &  values = {},
const std::string &  sUsage = "",
minValue = std::numeric_limits<T>::lowest(),
maxValue = std::numeric_limits<T>::max(),
std::size_t  minOccurs = 1,
std::size_t  maxOccurs = 1,
const std::string &  sRegexPattern = {} 
)

Registers a numeric configuration item

Parameters
sNameName of the configuration item to be registered
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 42 of file configurationregistrar.inl.

◆ registerNumericAny()

virtual void EMANE::ConfigurationRegistrar::registerNumericAny ( 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 = {} 
)
protectedpure virtual

Registers a numeric configuration item using an Any.

Parameters
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.

◆ registerValidator()

virtual void EMANE::ConfigurationRegistrar::registerValidator ( ConfigurationValidator  validator)
pure virtual

Registers a ConfigurationValidator callable. This callable is passed the complete list of configuration sent to an NEM during Component::configure() and RunningStateMutable::processConfiguration(). The validator returns true to indicate the configuration is valid and flase to indicate an error.

Parameters
validator
Note
Configuration updates are transactional, so when a validator returns flase the NEM will not see any of the configuration passed in via Component::configure() or RunningStateMutable::processConfiguration().
For RunningStateMutable::processConfiguration() a validator is the only way to indicate an error in the configuration.

Implemented in EMANE::ConfigurationRegistrarProxy.


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