ADTF Display Toolbox
Loading...
Searching...
No Matches
adtf::disptb Namespace Reference

Namespace for functionality provided by the Display Toolbox. More...

Namespaces

namespace  mixinlib
 Namespace for functionality provided by the Mixin Library.
 

Functions

std::string BuildPropertyName (std::string const &prefix, std::string const &prop_name)
 Rule to build a full property name, based on its prefix and (base) name.
 
template<typename T>
void AttachPropertyEntry (const tChar *prop_name_prefix, const tChar *prop_name, T const &prop_val, adtf::base::ant::IConfiguration &configuration)
 Attaches a property and its value to a given configuration.
 
template<typename T>
T GetPropertyValue (std::string const &prop_name_prefix, std::string const &prop_name, adtf::base::ant::IConfiguration const &configuration)
 Retrieves the value of a property from a given configuration.
 
bool HasProperty (std::string const &prop_name_prefix, std::string const &prop_name, adtf::base::ant::IConfiguration const &configuration)
 Query whether a configuration contains a property.
 
template<typename ValueType>
ValueType RestorePropertyValue (std::string const &prefix, std::string const &prop_name, adtf::base::ant::IConfiguration const &configuration)
 Restores the value of a property from a given configuration.
 

Variables

static constexpr char property_separator [] = "."
 Define a separator for properties.
 

Detailed Description

Namespace for functionality provided by the Display Toolbox.

Function Documentation

◆ AttachPropertyEntry()

template<typename T>
void AttachPropertyEntry ( const tChar * prop_name_prefix,
const tChar * prop_name,
T const & prop_val,
adtf::base::ant::IConfiguration & configuration )

Attaches a property and its value to a given configuration.

Note: only use with supported property value types (parameter prop_val), e.g. cString, tBool, tFloat

Parameters
[in]prop_name_prefixThe prefix of the property.
[in]prop_nameThe name of the property.
[in]prop_valThe value of the property.
[in]configurationThe configuration to add the entry to.

Definition at line 44 of file adtf_display_toolbox_base.h.

References BuildPropertyName().

◆ BuildPropertyName()

std::string BuildPropertyName ( std::string const & prefix,
std::string const & prop_name )
inline

Rule to build a full property name, based on its prefix and (base) name.

Parameters
[in]prefixThe prefix of the property.
[in]prop_nameThe name of the property.
Returns
String representing the full property name.

Definition at line 29 of file adtf_display_toolbox_base.h.

References property_separator.

Referenced by AttachPropertyEntry(), GetPropertyValue(), HasProperty(), and RestorePropertyValue().

◆ GetPropertyValue()

template<typename T>
T GetPropertyValue ( std::string const & prop_name_prefix,
std::string const & prop_name,
adtf::base::ant::IConfiguration const & configuration )

Retrieves the value of a property from a given configuration.

Note: only use with supported property value types (parameter prop_val), e.g. cString, tBool, tFloat

Parameters
[in]prop_name_prefixThe prefix of the property.
[in]prop_nameThe name of the property.
[in]configurationThe configuration to add the entry.
Returns
T The requested value type of the property.

Definition at line 63 of file adtf_display_toolbox_base.h.

References BuildPropertyName().

Referenced by RestorePropertyValue().

◆ HasProperty()

bool HasProperty ( std::string const & prop_name_prefix,
std::string const & prop_name,
adtf::base::ant::IConfiguration const & configuration )
inline

Query whether a configuration contains a property.

Parameters
[in]prop_name_prefixThe prefix of the property.
[in]prop_nameThe name of the property.
[in]configurationThe configuration to add the entry.
Returns
bool Boolean value indicating whether the configuration contains the property .

Definition at line 79 of file adtf_display_toolbox_base.h.

References BuildPropertyName().

Referenced by RestorePropertyValue().

◆ RestorePropertyValue()

template<typename ValueType>
ValueType RestorePropertyValue ( std::string const & prefix,
std::string const & prop_name,
adtf::base::ant::IConfiguration const & configuration )

Restores the value of a property from a given configuration.

If the property cannot be found inside the configuration, an error report is given. Note: only use with supported property value types (parameter prop_val), e.g. cString, tBool, tFloat

Parameters
[in]prefixThe prefix of the property.
[in]prop_nameThe name of the property.
[in]configurationThe configuration which should contain the property.
Returns
T The requested value type of the value which is to be restored..

Definition at line 101 of file adtf_display_toolbox_base.h.

References BuildPropertyName(), GetPropertyValue(), and HasProperty().

Variable Documentation

◆ property_separator

char property_separator[] = "."
staticconstexpr

Define a separator for properties.

Definition at line 20 of file adtf_display_toolbox_base.h.

Referenced by BuildPropertyName().