clockUtils
1.1
|
specialization of the variable, depending on the template type More...
#include <BasicVariable.h>
Public Member Functions | |
Variable (const std::string &longname, const std::string &shortname, const std::string &description, T value, bool required, bool multiple) | |
initializes a new variable taking the argument name, the description text and a default value, calls constructor of BasicVariable More... | |
bool | isBool () const override |
returns true, if T is bool, otherwise false. Default implementation always returns false, for bool this method is specialized More... | |
bool | setValue (const std::string &value) override |
sets the parsed value of the argument and returns true, if value was valid, otherwise false More... | |
T & | operator= (const T &val) |
assignment operator taking type T More... | |
operator T () const | |
operator casting Variable<T> to T More... | |
size_t | count () const |
returns amount of values provided if using multiple More... | |
T | at (size_t idx) const |
returns value at position idx, idx = 0 is _value, idx = 1 is first element of _values, idx >= count results in undefined behaviour More... | |
template<> | |
bool CLOCK_ARGPARSER_API | setValue (const std::string &value) |
specialization of setValue for std::string so it can work with strings containing spaces More... | |
template<> | |
bool CLOCK_ARGPARSER_API | setValue (const std::string &value) |
specialization of setValue for char because chars contain only one single character More... | |
template<> | |
bool CLOCK_ARGPARSER_API | setValue (const std::string &value) |
specialization of setValue for bool because it shall also allow usage of true and false More... | |
Public Member Functions inherited from clockUtils::argParser::BasicVariable | |
BasicVariable (const std::string &longname, const std::string &shortname, const std::string &description, bool required, bool multiple) | |
constructor taking the longname (= argument in argument list), shortname (= short name for the argument list) and a description text for –help, inserts variable into the variableList of the Parser More... | |
virtual | ~BasicVariable () |
destructor, removes variable of the variableList of the Parser More... | |
std::string | getLongname () const |
returns the argument of the variable More... | |
std::string | getShortname () const |
returns the argument of the variable More... | |
bool | isSet () const |
returns true, if this variable was set via command line More... | |
bool | isRequired () const |
returns true, if this variable is required to be set More... | |
bool | canHaveMultiple () const |
returns true, if this variable can have multiple values More... | |
Friends | |
bool | operator== (const T &first, const Variable< T > &second) |
operator comparing type T and Variable containing type T More... | |
bool | operator== (const Variable< T > &first, const T &second) |
bool | operator!= (const T &first, const Variable< T > &second) |
bool | operator!= (const Variable< T > &first, const T &second) |
std::ostream & | operator<< (std::ostream &out, Variable &v) |
stream operator More... | |
Additional Inherited Members | |
Protected Attributes inherited from clockUtils::argParser::BasicVariable | |
bool | _set |
tells whether the variable was set via command line or not More... | |
specialization of the variable, depending on the template type
Definition at line 143 of file BasicVariable.h.
|
inline |
initializes a new variable taking the argument name, the description text and a default value, calls constructor of BasicVariable
Definition at line 148 of file BasicVariable.h.
|
inline |
returns value at position idx, idx = 0 is _value, idx = 1 is first element of _values, idx >= count results in undefined behaviour
Definition at line 225 of file BasicVariable.h.
|
inline |
returns amount of values provided if using multiple
Definition at line 218 of file BasicVariable.h.
|
inlineoverridevirtual |
returns true, if T is bool, otherwise false. Default implementation always returns false, for bool this method is specialized
Implements clockUtils::argParser::BasicVariable.
Definition at line 154 of file BasicVariable.h.
|
inline |
operator casting Variable<T> to T
Definition at line 203 of file BasicVariable.h.
|
inline |
assignment operator taking type T
Definition at line 195 of file BasicVariable.h.
|
inlineoverridevirtual |
sets the parsed value of the argument and returns true, if value was valid, otherwise false
Implements clockUtils::argParser::BasicVariable.
Definition at line 161 of file BasicVariable.h.
|
virtual |
specialization of setValue for std::string so it can work with strings containing spaces
Implements clockUtils::argParser::BasicVariable.
|
virtual |
specialization of setValue for char because chars contain only one single character
Implements clockUtils::argParser::BasicVariable.
|
virtual |
specialization of setValue for bool because it shall also allow usage of true and false
Implements clockUtils::argParser::BasicVariable.
|
friend |
Definition at line 184 of file BasicVariable.h.
|
friend |
Definition at line 188 of file BasicVariable.h.
|
friend |
stream operator
Definition at line 210 of file BasicVariable.h.
|
friend |
operator comparing type T and Variable containing type T
Definition at line 176 of file BasicVariable.h.
|
friend |
Definition at line 180 of file BasicVariable.h.