ifw-core  5.0.0-pre2
Public Member Functions | Protected Attributes | List of all members
core::utils::param::Parameter Class Reference

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. More...
 
template<class TYPE >
 Parameter (const std::string name, const TYPE &value, const std::string comment="")
 Constructor settting internal members. More...
 
 Parameter (const Parameter &source)
 Copy constructor. More...
 
 ~Parameter ()
 
ParameterClear ()
 Clear the internal members. More...
 
ParameterSetName (const std::string name)
 Set parameter name. More...
 
ParameterSetLowLevelName (const std::string name)
 Set the low level parameter name. More...
 
ParameterSetMetaName (const std::string name)
 Set Meta-data parameter name. More...
 
bool NameDefined (const std::string &name, const bool tolerant=false) const
 Check if a given name is defined in the object. More...
 
bool MatchName (const std::string &name_regex) const
 Check if a given name is defined in the object; name specified as a regex. More...
 
const std::string & GetName () const
 Return parameter name. More...
 
const std::string & GetLowLevelName () const
 Return the low level parameter name. More...
 
const std::string & GetMetaName () const
 Return Meta-data parameter name. More...
 
std::string GetNames () const
 Generate a string summarising the three possible names (<name 1>/<name 2>/<name 3>). More...
 
ParameterSetValue (const std::string &value)
 Set parameter value. More...
 
ParameterSetValue (const char *value)
 Set parameter value. More...
 
template<class TYPE >
ParameterSetValue (TYPE value)
 Set parameter value as its native data type. More...
 
const std::string & GetValue () const
 Get parameter value as a string. More...
 
bool NoValue () const
 Return true if no value has been set for the parameter. More...
 
template<class TYPE >
void GetValue (TYPE &value) const
 Get parameter value as its native data type. More...
 
template<class TYPE >
TYPE GetValue () const
 Get parameter value as its native data type. More...
 
bool GetValueAsBool () const
 Return value as a boolean. If string representaion of value is not a boolean, the behaviour is undefined. More...
 
int64_t GetValueAsInt () const
 Return value as integer. If string representaion of value is not an integer, the behaviour is undefined. More...
 
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. More...
 
double GetValueAsDouble () const
 Return value as a double. If string representaion of value is not a double, the behaviour is undefined. More...
 
ParameterSetComment (const std::string &comment)
 Set parameter comment. More...
 
const std::string & GetComment () const
 Get parameter comment. More...
 
std::string ToString () const
 Print out parameter. More...
 
Parameteroperator= (const Parameter &source)
 Copy operator. More...
 

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
 

Detailed Description

Class to handle information for one parameter.

Constructor & Destructor Documentation

◆ Parameter() [1/4]

core::utils::param::Parameter::Parameter ( )

◆ Parameter() [2/4]

core::utils::param::Parameter::Parameter ( const std::string  name,
const std::string  value,
const std::string  comment = "" 
)

Constructor settting internal members.

◆ Parameter() [3/4]

template<class TYPE >
core::utils::param::Parameter::Parameter ( const std::string  name,
const TYPE &  value,
const std::string  comment = "" 
)
inline

Constructor settting internal members.

◆ Parameter() [4/4]

core::utils::param::Parameter::Parameter ( const Parameter source)

Copy constructor.

◆ ~Parameter()

core::utils::param::Parameter::~Parameter ( )

Member Function Documentation

◆ Clear()

Parameter & core::utils::param::Parameter::Clear ( )

Clear the internal members.

◆ GetComment()

const std::string & core::utils::param::Parameter::GetComment ( ) const

Get parameter comment.

◆ GetLowLevelName()

const std::string & core::utils::param::Parameter::GetLowLevelName ( ) const

Return the low level parameter name.

◆ GetMetaName()

const std::string & core::utils::param::Parameter::GetMetaName ( ) const

Return Meta-data parameter name.

◆ GetName()

const std::string & core::utils::param::Parameter::GetName ( ) const

Return parameter name.

◆ GetNames()

std::string core::utils::param::Parameter::GetNames ( ) const

Generate a string summarising the three possible names (<name 1>/<name 2>/<name 3>).

◆ GetValue() [1/3]

const std::string & core::utils::param::Parameter::GetValue ( ) const

Get parameter value as a string.

◆ GetValue() [2/3]

template<class TYPE >
TYPE core::utils::param::Parameter::GetValue ( ) const
inline

Get parameter value as its native data type.

◆ GetValue() [3/3]

template<class TYPE >
void core::utils::param::Parameter::GetValue ( TYPE &  value) const
inline

Get parameter value as its native data type.

◆ GetValueAsBool()

bool core::utils::param::Parameter::GetValueAsBool ( ) const

Return value as a boolean. If string representaion of value is not a boolean, the behaviour is undefined.

◆ GetValueAsDouble()

double core::utils::param::Parameter::GetValueAsDouble ( ) const

Return value as a double. If string representaion of value is not a double, the behaviour is undefined.

◆ GetValueAsInt()

int64_t core::utils::param::Parameter::GetValueAsInt ( ) const

Return value as integer. If string representaion of value is not an integer, the behaviour is undefined.

◆ GetValueAsInt64()

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

◆ MatchName()

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

◆ NameDefined()

bool core::utils::param::Parameter::NameDefined ( const std::string &  name,
const bool  tolerant = false 
) const

Check if a given name is defined in the object.

◆ NoValue()

bool core::utils::param::Parameter::NoValue ( ) const

Return true if no value has been set for the parameter.

◆ operator=()

Parameter & core::utils::param::Parameter::operator= ( const Parameter source)

Copy operator.

◆ SetComment()

Parameter & core::utils::param::Parameter::SetComment ( const std::string &  comment)

Set parameter comment.

◆ SetLowLevelName()

Parameter & core::utils::param::Parameter::SetLowLevelName ( const std::string  name)

Set the low level parameter name.

◆ SetMetaName()

Parameter & core::utils::param::Parameter::SetMetaName ( const std::string  name)

Set Meta-data parameter name.

◆ SetName()

Parameter & core::utils::param::Parameter::SetName ( const std::string  name)

Set parameter name.

◆ SetValue() [1/3]

Parameter & core::utils::param::Parameter::SetValue ( const char *  value)

Set parameter value.

◆ SetValue() [2/3]

Parameter & core::utils::param::Parameter::SetValue ( const std::string &  value)

Set parameter value.

◆ SetValue() [3/3]

template<class TYPE >
Parameter& core::utils::param::Parameter::SetValue ( TYPE  value)
inline

Set parameter value as its native data type.

◆ ToString()

std::string core::utils::param::Parameter::ToString ( ) const

Print out parameter.

Member Data Documentation

◆ m_comment

std::string core::utils::param::Parameter::m_comment
protected

◆ m_low_level_name

std::string core::utils::param::Parameter::m_low_level_name
protected

◆ m_meta_name

std::string core::utils::param::Parameter::m_meta_name
protected

◆ m_name

std::string core::utils::param::Parameter::m_name
protected

◆ m_no_value

std::string core::utils::param::Parameter::m_no_value
protected

◆ m_value

std::string core::utils::param::Parameter::m_value
protected

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