ADTF File Library
Loading...
Searching...
No Matches
adtf_file::PropertyBuilder< T > Class Template Reference

The PropertyBuilder class is an easy way to define a property with additional meta information. Multiple properties can be easily linked to an entire configuration using the "+" operator. More...

#include <configuration.h>

Inheritance diagram for adtf_file::PropertyBuilder< T >:
[legend]
Collaboration diagram for adtf_file::PropertyBuilder< T >:
[legend]

Public Member Functions

 PropertyBuilder (std::string name, T default_value)
 Sets a property with name and default value. Hierarchically grouped properties are created with the '/'.
 
PropertyBuildersetDescription (const std::string &description)
 Sets a description for the property.
 
PropertyBuildersetDisplayName (const std::string &display_name)
 Sets a display name for the property. Please note that '/' is used for hierarchical grouping of properties.
 
PropertyBuildersetValueList (const std::vector< std::pair< T, std::string > > &value_list, bool restrict_to_values)
 Sets a value list for the property.
 
PropertyBuildersetMinMax (const T &min, const T &max)
 Sets a minimum/maximum range for the property value.
 

Detailed Description

template<typename T = std::string>
class adtf_file::PropertyBuilder< T >

The PropertyBuilder class is an easy way to define a property with additional meta information. Multiple properties can be easily linked to an entire configuration using the "+" operator.

Constructor & Destructor Documentation

◆ PropertyBuilder()

template<typename T = std::string>
adtf_file::PropertyBuilder< T >::PropertyBuilder ( std::string name,
T default_value )
inline

Sets a property with name and default value. Hierarchically grouped properties are created with the '/'.

Parameters
nameName of the property. Please consider the naming convention: "lower_snake_case".
default_valueDefault value of the property.

Member Function Documentation

◆ setDescription()

template<typename T = std::string>
PropertyBuilder & adtf_file::PropertyBuilder< T >::setDescription ( const std::string & description)
inline

Sets a description for the property.

Parameters
descriptionDescription.
Returns
Self-Reference.

◆ setDisplayName()

template<typename T = std::string>
PropertyBuilder & adtf_file::PropertyBuilder< T >::setDisplayName ( const std::string & display_name)
inline

Sets a display name for the property. Please note that '/' is used for hierarchical grouping of properties.

Parameters
display_nameDisplay name.
Returns
Self-Reference.

◆ setMinMax()

template<typename T = std::string>
PropertyBuilder & adtf_file::PropertyBuilder< T >::setMinMax ( const T & min,
const T & max )
inline

Sets a minimum/maximum range for the property value.

Parameters
minMinimum limit.
maxMaximum limit.
Returns
Self-Reference.

◆ setValueList()

template<typename T = std::string>
PropertyBuilder & adtf_file::PropertyBuilder< T >::setValueList ( const std::vector< std::pair< T, std::string > > & value_list,
bool restrict_to_values )
inline

Sets a value list for the property.

Parameters
value_listList of values with descriptiones.
restrict_to_valuestrue, only the values from the list are valid. false, the values from the list are only suggestions for reasonable values.
Returns
Self-Reference.

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