Class to handle information for one parameter. More...
#include <parameter.hpp>
Public Member Functions | |
| Parameter () | |
| Parameter (const std::string name, const std::string value, const std::string comment="") | |
| Constructor settting internal members. | |
| template<class TYPE> | |
| Parameter (const std::string name, const TYPE &value, const std::string comment="") | |
| Constructor settting internal members. | |
| Parameter (const Parameter &source) | |
| Copy constructor. | |
| ~Parameter () | |
| Parameter & | Clear () |
| Clear the internal members. | |
| Parameter & | SetName (const std::string name) |
| Set parameter name. | |
| Parameter & | SetLowLevelName (const std::string name) |
| Set the low level parameter name. | |
| Parameter & | SetMetaName (const std::string name) |
| Set Meta-data parameter name. | |
| bool | NameDefined (const std::string &name, const bool tolerant=false) const |
| Check if a given name is defined in the object. | |
| bool | MatchName (const std::string &name_regex) const |
| Check if a given name is defined in the object; name specified as a regex. | |
| const std::string & | GetName () const |
| Return parameter name. | |
| const std::string & | GetLowLevelName () const |
| Return the low level parameter name. | |
| const std::string & | GetMetaName () const |
| Return Meta-data parameter name. | |
| std::string | GetNames () const |
| Generate a string summarising the three possible names (<name 1>/<name 2>/<name 3>). | |
| Parameter & | SetValue (const std::string &value, const ifw::fnd::datatype::DataType data_type=ifw::fnd::datatype::DataType::UNSPECIFIED) |
| Set parameter value. | |
| Parameter & | SetValue (const char *value, const ifw::fnd::datatype::DataType data_type=ifw::fnd::datatype::DataType::UNSPECIFIED) |
| Set parameter value. | |
| template<class TYPE> | |
| Parameter & | SetValue (TYPE value) |
| Set parameter value as its native data type. | |
| const std::string & | GetValue () const |
| Get parameter value as a string. | |
| ifw::fnd::datatype::DataType | GetDataType () const |
| Return the data type for the parameter, if defined. | |
| bool | NoValue () const |
| Return true if no value has been set for the parameter. | |
| template<class TYPE> | |
| void | GetValue (TYPE &value) const |
| Get parameter value as its native data type. | |
| template<class TYPE> | |
| TYPE | GetValue () const |
| Get parameter value as its native data type. | |
| bool | GetValueAsBool () const |
| Return value as a boolean. If string representaion of value is not a boolean, the behaviour is undefined. | |
| int64_t | GetValueAsInt () const |
| Return value as integer. If string representaion of value is not an integer, the behaviour is undefined. | |
| int64_t | GetValueAsInt64 () const |
| Return value as 64 bit integer. If string representaion of value is not a 64 bit integer, the behaviour is undefined. | |
| double | GetValueAsDouble () const |
| Return value as a double. If string representaion of value is not a double, the behaviour is undefined. | |
| Parameter & | SetComment (const std::string &comment) |
| Set parameter comment. | |
| const std::string & | GetComment () const |
| Get parameter comment. | |
| std::string | ToString () const |
| Print out parameter. | |
| Parameter & | operator= (const Parameter &source) |
| Copy operator. | |
Protected Attributes | |
| std::string | m_name |
| std::string | m_low_level_name |
| std::string | m_meta_name |
| std::string | m_value |
| std::string | m_comment |
| std::string | m_no_value |
| ifw::fnd::datatype::DataType | m_data_type {ifw::fnd::datatype::DataType::UNSPECIFIED} |
Class to handle information for one parameter.
| ifw::core::utils::param::Parameter::Parameter | ( | ) |
| ifw::core::utils::param::Parameter::Parameter | ( | const std::string | name, |
| const std::string | value, | ||
| const std::string | comment = "" ) |
Constructor settting internal members.
|
inline |
Constructor settting internal members.
| ifw::core::utils::param::Parameter::Parameter | ( | const Parameter & | source | ) |
Copy constructor.
| ifw::core::utils::param::Parameter::~Parameter | ( | ) |
| Parameter & ifw::core::utils::param::Parameter::Clear | ( | ) |
Clear the internal members.
| const std::string & ifw::core::utils::param::Parameter::GetComment | ( | ) | const |
Get parameter comment.
| ifw::fnd::datatype::DataType ifw::core::utils::param::Parameter::GetDataType | ( | ) | const |
Return the data type for the parameter, if defined.
| const std::string & ifw::core::utils::param::Parameter::GetLowLevelName | ( | ) | const |
Return the low level parameter name.
| const std::string & ifw::core::utils::param::Parameter::GetMetaName | ( | ) | const |
Return Meta-data parameter name.
| const std::string & ifw::core::utils::param::Parameter::GetName | ( | ) | const |
Return parameter name.
| std::string ifw::core::utils::param::Parameter::GetNames | ( | ) | const |
Generate a string summarising the three possible names (<name 1>/<name 2>/<name 3>).
| const std::string & ifw::core::utils::param::Parameter::GetValue | ( | ) | const |
Get parameter value as a string.
|
inline |
Get parameter value as its native data type.
|
inline |
Get parameter value as its native data type.
| bool ifw::core::utils::param::Parameter::GetValueAsBool | ( | ) | const |
Return value as a boolean. If string representaion of value is not a boolean, the behaviour is undefined.
| double ifw::core::utils::param::Parameter::GetValueAsDouble | ( | ) | const |
Return value as a double. If string representaion of value is not a double, the behaviour is undefined.
| int64_t ifw::core::utils::param::Parameter::GetValueAsInt | ( | ) | const |
Return value as integer. If string representaion of value is not an integer, the behaviour is undefined.
| int64_t ifw::core::utils::param::Parameter::GetValueAsInt64 | ( | ) | const |
Return value as 64 bit integer. If string representaion of value is not a 64 bit integer, the behaviour is undefined.
| bool ifw::core::utils::param::Parameter::MatchName | ( | const std::string & | name_regex | ) | const |
Check if a given name is defined in the object; name specified as a regex.
| bool ifw::core::utils::param::Parameter::NameDefined | ( | const std::string & | name, |
| const bool | tolerant = false ) const |
Check if a given name is defined in the object.
| bool ifw::core::utils::param::Parameter::NoValue | ( | ) | const |
Return true if no value has been set for the parameter.
Copy operator.
| Parameter & ifw::core::utils::param::Parameter::SetComment | ( | const std::string & | comment | ) |
Set parameter comment.
| Parameter & ifw::core::utils::param::Parameter::SetLowLevelName | ( | const std::string | name | ) |
Set the low level parameter name.
| Parameter & ifw::core::utils::param::Parameter::SetMetaName | ( | const std::string | name | ) |
Set Meta-data parameter name.
| Parameter & ifw::core::utils::param::Parameter::SetName | ( | const std::string | name | ) |
Set parameter name.
| Parameter & ifw::core::utils::param::Parameter::SetValue | ( | const char * | value, |
| const ifw::fnd::datatype::DataType | data_type = ifw::fnd::datatype::DataType::UNSPECIFIED ) |
Set parameter value.
| Parameter & ifw::core::utils::param::Parameter::SetValue | ( | const std::string & | value, |
| const ifw::fnd::datatype::DataType | data_type = ifw::fnd::datatype::DataType::UNSPECIFIED ) |
Set parameter value.
|
inline |
Set parameter value as its native data type.
| std::string ifw::core::utils::param::Parameter::ToString | ( | ) | const |
Print out parameter.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |