sofa::helper::Argument< T > Class Template Reference

Command line argument. More...

#include <ArgumentParser.h>

Inheritance diagram for sofa::helper::Argument< T >:

Inheritance graph
[legend]
Collaboration diagram for sofa::helper::Argument< T >:

Collaboration graph
[legend]

Public Member Functions

 Argument (T *t, char sn, string ln, string h, bool m)
 Constructor.
void printValue () const
 General case for printing default value.

Private Member Functions

bool read (std::list< std::string > &str)
 Try to read argument value from an input stream.

Private Attributes

T * ptr
 Pointer to the parameter.

Detailed Description

template<class T = void*>
class sofa::helper::Argument< T >

Command line argument.

Contains a pointer to a value which can be parsed by a ArgumentParser.Contains also a short name, a long name and a help message.

See also:
ArgumentParser

Definition at line 104 of file ArgumentParser.h.


Constructor & Destructor Documentation

template<class T = void*>
sofa::helper::Argument< T >::Argument ( T *  t,
char  sn,
string  ln,
string  h,
bool  m 
) [inline]

Constructor.

Parameters:
t a pointer to the value
sn short name of the argument
ln long name of the argument
h help on the argument
m true iff the argument is mandatory

Definition at line 114 of file ArgumentParser.h.


Member Function Documentation

template<class T >
void Argument< T >::printValue (  )  const [inline, virtual]

General case for printing default value.

Implements sofa::helper::ArgumentBase.

Definition at line 203 of file ArgumentParser.h.

References sofa::helper::Argument< T >::ptr.

template<class T = void*>
bool sofa::helper::Argument< T >::read ( std::list< std::string > &  str  )  [inline, private, virtual]

Try to read argument value from an input stream.

Return false if failed

Implements sofa::helper::ArgumentBase.

Definition at line 129 of file ArgumentParser.h.

References sofa::helper::ArgumentBase::isSet, and sofa::helper::Argument< T >::ptr.


Field Documentation

template<class T = void*>
T* sofa::helper::Argument< T >::ptr [private]

Pointer to the parameter.

Definition at line 123 of file ArgumentParser.h.

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


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

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