Public Member Functions | Protected Attributes

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

Command line option with argument. More...

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

List of all members.

Public Member Functions

 Option (T *const var, bool *const flag)
 Constructor.
virtual ~Option ()
 Virtual destructor.
virtual void Evaluate (const size_t argc, const char *argv[], size_t &index)
 Evaluate and set associated option.
virtual mxml_node_t * MakeXML (mxml_node_t *const parent) const
 Virtual function that returns an XML tree describing this option.
virtual std::string GetParamTypeString () const
 Return a textual description of the parameter associated with 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).

Protected Attributes

T * Var
 Pointer to associated variable.
bool * Flag
 Pointer to (optional) flag that will be set when this option occurs.

Detailed Description

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

Command line option with argument.

Definition at line 426 of file cmtkCommandLine.h.


Constructor & Destructor Documentation

template<class T>
cmtk::CommandLine::Option< T >::Option ( T *const   var,
bool *const   flag 
) [inline]

Constructor.

Definition at line 432 of file cmtkCommandLine.h.

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

Virtual destructor.

Definition at line 435 of file cmtkCommandLine.h.


Member Function Documentation

template<class T >
void cmtk::CommandLine::Option< T >::Evaluate ( const size_t  argc,
const char *  argv[],
size_t &  index 
) [virtual]

Evaluate and set associated option.

Implements cmtk::CommandLine::Item.

Reimplemented in cmtk::CommandLine::NonOptionParameter, and cmtk::CommandLine::NonOptionParameterVector.

Definition at line 36 of file cmtkCommandLineOption.txx.

template<class T >
std::string cmtk::CommandLine::Option< T >::GetParamTypeString (  ) const [virtual]

Return a textual description of the parameter associated with this option.

Reimplemented from cmtk::CommandLine::Item.

Reimplemented in cmtk::CommandLine::NonOptionParameter, and cmtk::CommandLine::NonOptionParameterVector.

Definition at line 77 of file cmtkCommandLineOption.txx.

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

Virtual function that returns an XML tree describing this option.

Implements cmtk::CommandLine::Item.

Definition at line 54 of file cmtkCommandLineOption.txx.

References NULL.

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

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

Parameters:
fmtStream that the additional help information is formatted into

Reimplemented from cmtk::CommandLine::Item.

Reimplemented in cmtk::CommandLine::NonOptionParameter, and cmtk::CommandLine::NonOptionParameterVector.

Definition at line 85 of file cmtkCommandLineOption.txx.

References cmtk::CommandLineTypeTraitsBase< T >::ValueToString().

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

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

Reimplemented from cmtk::CommandLine::Item.

Reimplemented in cmtk::CommandLine::NonOptionParameter, and cmtk::CommandLine::NonOptionParameterVector.

Definition at line 97 of file cmtkCommandLineOption.txx.

References cmtk::StdOut, and cmtk::CommandLineTypeTraitsBase< T >::ValueToString().


Member Data Documentation

template<class T>
bool* cmtk::CommandLine::Option< T >::Flag [protected]

Pointer to (optional) flag that will be set when this option occurs.

Definition at line 458 of file cmtkCommandLine.h.

template<class T>
T* cmtk::CommandLine::Option< T >::Var [protected]

Pointer to associated variable.

Definition at line 455 of file cmtkCommandLine.h.


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