ArgumentBase Struct Reference

#include <argumentParser.h>

Inheritance diagram for ArgumentBase:

Inheritance graph
[legend]
Collaboration diagram for ArgumentBase:

Collaboration graph
[legend]

Detailed Description

Abstract base class for all command line arguments.

Definition at line 23 of file argumentParser.h.


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.

Member Typedef Documentation

typedef std::string ArgumentBase::string

character string

Definition at line 26 of file argumentParser.h.


Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 34 of file argumentParser.h.

virtual ArgumentBase::~ArgumentBase (  )  [inline, virtual]

Base destructor: does nothing.

Definition at line 43 of file argumentParser.h.


Member Function Documentation

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

Read the command line.

Implemented in Argument< T >, Argument< T >, Argument< T >, Argument< T >, Argument< T >, and Argument< T >.

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

Print the value of the associated variable.

Implemented in Argument< T >, and Argument< T >.

Referenced by print(), and sofa::helper::ArgumentBase::print().

void ArgumentBase::print (  )  const [inline]

print short name, long name, help

Definition at line 56 of file argumentParser.h.

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


Field Documentation

char ArgumentBase::shortName

Short name.

Definition at line 51 of file argumentParser.h.

Referenced by ArgumentParser::operator()(), ArgumentParser::option(), ArgumentParser::parameter(), print(), and sofa::helper::ArgumentBase::print().

string ArgumentBase::longName

Long name.

Definition at line 52 of file argumentParser.h.

Referenced by ArgumentParser::operator()(), ArgumentParser::option(), ArgumentParser::parameter(), print(), and sofa::helper::ArgumentBase::print().

string ArgumentBase::help

Help message.

Definition at line 53 of file argumentParser.h.

Referenced by print(), and sofa::helper::ArgumentBase::print().

bool ArgumentBase::mandatory

True iff the value must be set.

Definition at line 65 of file argumentParser.h.

Referenced by print(), and sofa::helper::ArgumentBase::print().

bool ArgumentBase::isSet

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

Definition at line 68 of file argumentParser.h.

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


The documentation for this struct was generated from the following file:
Generated on Mon May 5 23:30:59 2008 for Sofa by  doxygen 1.5.3