|
Provides access to Ice properties with extended capabilities. More...
#include <ArmarXCore/core/application/properties/Property.h>
Public Types | |
typedef PropertyDefinition< PropertyType >::PropertyValuesMap | PropertyValuesMap |
Property value map type definition. More... | |
Public Member Functions | |
PropertyType | getValue () |
Returns the property value set in a config file or passed as a command-line option. More... | |
template<class T = PropertyType> | |
std::enable_if_t< std::is_same_v< T, std::string >, T > | getValueAndReplaceAllVars () |
template<class T = PropertyType> | |
std::enable_if_t< std::is_same_v< T, std::vector< std::string > >, T > | getValueAndReplaceAllVars () |
bool | isConstant () const |
Checks if this property is constant or if it can be changed at runtime. More... | |
bool | isRequired () const |
Checks if this property is required. More... | |
bool | isSet () const |
Checks whether the property is set. More... | |
operator PropertyType () | |
Convenience overload of getValue(). More... | |
Property (PropertyDefinition< PropertyType > definition, std::string prefix, Ice::PropertiesPtr properties) | |
Property constructor. More... | |
Provides access to Ice properties with extended capabilities.
The Property template class provides access to Ice config properties and command line options. Its main capability is to map a string value on any type that is required and put constrains on the value as well as on the property itself at the same time. For instance you can specify that a certain property is required for the component to proceed or a property may require a specific value syntax or even numeric bounds which may not be exceeded. These features and few more are supported by the Property combined with the PropertyDefinition.
Definition at line 78 of file Property.h.
typedef PropertyDefinition<PropertyType>::PropertyValuesMap PropertyValuesMap |
Property value map type definition.
Definition at line 85 of file Property.h.
Property | ( | PropertyDefinition< PropertyType > | definition, |
std::string | prefix, | ||
Ice::PropertiesPtr | properties | ||
) |
PropertyType getValue |
Returns the property value set in a config file or passed as a command-line option.
If property is not set, the default value is returned unless the property is required. In the latter case an exception is thrown indicating that the required property is not set.
armarx::exceptions::local::ValueRangeExceededException | |
armarx::exceptions::local::InvalidPropertyValueException |
Definition at line 207 of file Property.h.
bool isConstant |
Checks if this property is constant or if it can be changed at runtime.
Definition at line 225 of file Property.h.
bool isRequired |
Checks if this property is required.
Definition at line 216 of file Property.h.
bool isSet |
Checks whether the property is set.
Definition at line 234 of file Property.h.
|
inline |
Convenience overload of getValue().
Usage:
Definition at line 141 of file Property.h.