Documentation


animal::Argument< T > Struct Template Reference

#include <argumentParser.h>

Inheritance diagram for animal::Argument< T >:

animal::ArgumentBase List of all members.

Detailed Description

template<class T = void*>
struct animal::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 85 of file argumentParser.h.

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::istream &str)
 Specialisation for flag reading bool.


Private Attributes

T * ptr
 Pointer to the parameter.


Constructor & Destructor Documentation

template<class T = void*>
animal::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 95 of file argumentParser.h.

References animal::Argument< T >::ptr.


Member Function Documentation

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

General case for printing default value.

Implements animal::ArgumentBase.

Definition at line 131 of file argumentParser.h.

References animal::Argument< T >::ptr.

bool animal::Argument<>::read std::istream &  str  )  [inline, private, virtual]
 

Specialisation for flag reading bool.

Return false if failed

Implements animal::ArgumentBase.

Definition at line 110 of file argumentParser.h.

References animal::Argument< T >::ptr.


Member Data Documentation

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

Pointer to the parameter.

Definition at line 104 of file argumentParser.h.

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


The documentation for this struct was generated from the following file:
Generated on Thu Dec 23 13:52:29 2004 by doxygen 1.3.6