sofa::helper::ArgumentBase Class Reference

Abstract base class for all command line arguments. More...

#include <ArgumentParser.h>

Inheritance diagram for sofa::helper::ArgumentBase:

Inheritance graph
[legend]
Collaboration diagram for sofa::helper::ArgumentBase:

Collaboration graph
[legend]

Public Types

typedef std::string string
 character string

Public Member Functions

 ArgumentBase (char s, string l, string h, bool m)
 Constructor.
virtual ~ArgumentBase ()
 Base destructor: does nothing.
virtual bool read (std::list< std::string > &str)=0
 Read the command line.
virtual void printValue () const =0
 Print the value of the associated variable.
void print () const
 print short name, long name, help

Data Fields

char shortName
 Short name.
string longName
 Long name.
string help
 Help message.
bool mandatory
 True iff the value must be set.
bool isSet
 True iff a value has bee read on the command line.

Detailed Description

Abstract base class for all command line arguments.

Definition at line 55 of file ArgumentParser.h.


Member Typedef Documentation

character string

Definition at line 59 of file ArgumentParser.h.


Constructor & Destructor Documentation

ArgumentBase::ArgumentBase ( char  s,
string  l,
string  h,
bool  m 
)

Constructor.

Parameters:
s short name
l long name
h help
m true iff the argument is mandatory

Definition at line 41 of file ArgumentParser.cpp.

ArgumentBase::~ArgumentBase (  )  [virtual]

Base destructor: does nothing.

Definition at line 50 of file ArgumentParser.cpp.


Member Function Documentation

void ArgumentBase::print (  )  const

print short name, long name, help

Definition at line 54 of file ArgumentParser.cpp.

References help, longName, mandatory, printValue(), and shortName.

virtual void sofa::helper::ArgumentBase::printValue (  )  const [pure virtual]

Print the value of the associated variable.

Implemented in sofa::helper::Argument< T >.

Referenced by print().

virtual bool sofa::helper::ArgumentBase::read ( std::list< std::string > &  str  )  [pure virtual]

Read the command line.

Implemented in sofa::helper::Argument< T >.


Field Documentation

Help message.

Definition at line 83 of file ArgumentParser.h.

Referenced by print().

True iff a value has bee read on the command line.

Definition at line 89 of file ArgumentParser.h.

Referenced by sofa::helper::Argument< T >::read().

Long name.

Definition at line 82 of file ArgumentParser.h.

Referenced by print().

True iff the value must be set.

Definition at line 86 of file ArgumentParser.h.

Referenced by print().

Short name.

Definition at line 81 of file ArgumentParser.h.

Referenced by print().


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

Generated on Sun Nov 23 04:24:14 2008 for Sofa by  doxygen 1.5.7.1