Public Member Functions | Private Attributes

cmtk::CommandLine::Switch< T > Class Template Reference

Command line switch. More...

Inheritance diagram for cmtk::CommandLine::Switch< T >:
Inheritance graph
[legend]
Collaboration diagram for cmtk::CommandLine::Switch< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Switch (T *const field, const T value)
 Constructor.
virtual ~Switch ()
 Virtual destructor.
virtual void Evaluate (const size_t, const char *[], size_t &)
 Evaluate and set associated flag.
virtual mxml_node_t * MakeXML (mxml_node_t *const parent) const
 Virtual function that returns an XML tree describing this option.
virtual std::ostringstream & PrintHelp (std::ostringstream &fmt) const
 Format additional help information (e.g., default values).
virtual void PrintWiki () const
 Format additional help information (e.g., default values).
virtual bool IsDefault () const
 Return true if and only if this item is the default for the associated action or variable.

Private Attributes

T * m_Field
 Pointer to field handled by this switch.
const T m_Value
 Value to set field to when switch is encountered.

Detailed Description

template<class T>
class cmtk::CommandLine::Switch< T >

Command line switch.

Definition at line 363 of file cmtkCommandLine.h.


Constructor & Destructor Documentation

template<class T >
cmtk::CommandLine::Switch< T >::Switch ( T *const   field,
const T  value 
) [inline]

Constructor.

Definition at line 369 of file cmtkCommandLine.h.

template<class T >
virtual cmtk::CommandLine::Switch< T >::~Switch (  ) [inline, virtual]

Virtual destructor.

Definition at line 376 of file cmtkCommandLine.h.


Member Function Documentation

template<class T >
virtual void cmtk::CommandLine::Switch< T >::Evaluate ( const   size_t,
const char *  [],
size_t &   
) [inline, virtual]

Evaluate and set associated flag.

Implements cmtk::CommandLine::Item.

Definition at line 379 of file cmtkCommandLine.h.

template<class T >
virtual bool cmtk::CommandLine::Switch< T >::IsDefault (  ) const [inline, virtual]

Return true if and only if this item is the default for the associated action or variable.

Reimplemented from cmtk::CommandLine::Item.

Definition at line 411 of file cmtkCommandLine.h.

template<class T >
virtual mxml_node_t* cmtk::CommandLine::Switch< T >::MakeXML ( mxml_node_t *const   parent ) const [inline, virtual]

Virtual function that returns an XML tree describing this option.

Implements cmtk::CommandLine::Item.

Definition at line 385 of file cmtkCommandLine.h.

References NULL.

template<class T >
virtual std::ostringstream& cmtk::CommandLine::Switch< T >::PrintHelp ( std::ostringstream &  fmt ) const [inline, virtual]

Format additional help information (e.g., default values).

Parameters:
fmtStream that the additional help information is formatted into

Reimplemented from cmtk::CommandLine::Item.

Definition at line 395 of file cmtkCommandLine.h.

template<class T >
virtual void cmtk::CommandLine::Switch< T >::PrintWiki (  ) const [inline, virtual]

Format additional help information (e.g., default values).

Reimplemented from cmtk::CommandLine::Item.

Definition at line 404 of file cmtkCommandLine.h.

References cmtk::StdOut.


Member Data Documentation

template<class T >
T* cmtk::CommandLine::Switch< T >::m_Field [private]

Pointer to field handled by this switch.

Definition at line 418 of file cmtkCommandLine.h.

template<class T >
const T cmtk::CommandLine::Switch< T >::m_Value [private]

Value to set field to when switch is encountered.

Definition at line 421 of file cmtkCommandLine.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines