clockUtils  1.1
clockUtils::argParser::BasicVariable Class Referenceabstract

base class for Variable handling More...

#include <BasicVariable.h>

Inheritance diagram for clockUtils::argParser::BasicVariable:
Inheritance graph

Public Member Functions

 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...
 
virtual bool isBool () const =0
 returns whether the type of the variable is bool (true) or not (false) More...
 
virtual bool setValue (const std::string &value)=0
 sets a value received from parsing 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...
 
virtual void resetToDefault ()=0
 resets value to default value More...
 

Protected Attributes

bool _set
 tells whether the variable was set via command line or not More...
 

Friends

class Parser
 

Detailed Description

base class for Variable handling

Definition at line 42 of file BasicVariable.h.

Constructor & Destructor Documentation

§ BasicVariable()

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

§ ~BasicVariable()

virtual clockUtils::argParser::BasicVariable::~BasicVariable ( )
virtual

destructor, removes variable of the variableList of the Parser

Member Function Documentation

§ canHaveMultiple()

bool clockUtils::argParser::BasicVariable::canHaveMultiple ( ) const
inline

returns true, if this variable can have multiple values

Definition at line 97 of file BasicVariable.h.

§ getLongname()

std::string clockUtils::argParser::BasicVariable::getLongname ( ) const
inline

returns the argument of the variable

Definition at line 59 of file BasicVariable.h.

§ getShortname()

std::string clockUtils::argParser::BasicVariable::getShortname ( ) const
inline

returns the argument of the variable

Definition at line 66 of file BasicVariable.h.

§ isBool()

virtual bool clockUtils::argParser::BasicVariable::isBool ( ) const
pure virtual

returns whether the type of the variable is bool (true) or not (false)

Implemented in clockUtils::argParser::Variable< T >.

§ isRequired()

bool clockUtils::argParser::BasicVariable::isRequired ( ) const
inline

returns true, if this variable is required to be set

Definition at line 90 of file BasicVariable.h.

§ isSet()

bool clockUtils::argParser::BasicVariable::isSet ( ) const
inline

returns true, if this variable was set via command line

Definition at line 83 of file BasicVariable.h.

§ resetToDefault()

virtual void clockUtils::argParser::BasicVariable::resetToDefault ( )
pure virtual

resets value to default value

§ setValue()

virtual bool clockUtils::argParser::BasicVariable::setValue ( const std::string &  value)
pure virtual

Friends And Related Function Documentation

§ Parser

friend class Parser
friend

Definition at line 43 of file BasicVariable.h.

Member Data Documentation

§ _set

bool clockUtils::argParser::BasicVariable::_set
protected

tells whether the variable was set via command line or not

Definition at line 110 of file BasicVariable.h.


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