Public Types | Public Member Functions | Private Attributes | Friends

cmtk::CommandLine::KeyToActionEnum Class Reference

Local class that connects command line options with enum group evaluators. More...

#include <cmtkCommandLine.h>

Inheritance diagram for cmtk::CommandLine::KeyToActionEnum:
Inheritance graph
[legend]
Collaboration diagram for cmtk::CommandLine::KeyToActionEnum:
Collaboration graph
[legend]

List of all members.

Public Types

typedef KeyToAction Superclass
 Superclass.
typedef SmartPointer
< KeyToActionEnum
SmartPtr
 Smart pointer.

Public Member Functions

 KeyToActionEnum (const Key &key, EnumGroupBase::SmartPtr keyToActionEnum, const std::string &comment)
 Constructor for enumeration parameter group.
virtual ~KeyToActionEnum ()
 Virtual destructor.
bool MatchAndExecute (const std::string &key, const size_t argc, const char *argv[], size_t &index)
 Test long key from command line and execute if match.
bool MatchAndExecute (const char keyChar, const size_t argc, const char *argv[], size_t &index)
 Test short key from command line and execute if match.
virtual mxml_node_t * MakeXML (mxml_node_t *const parent) const
 Returns an XML tree describing this key and action.
virtual void PrintHelp (const size_t globalIndent=0) const
 Print help for this item.
virtual void PrintWikiWithPrefix (const std::string &prefix="") const
 Print help for this item in Wiki markup.

Private Attributes

EnumGroupBase::SmartPtr m_EnumGroup
 For enum parameter group, list of subkeys and action.

Friends

class EnumGroupBase
 Give enum group class full access.

Detailed Description

Local class that connects command line options with enum group evaluators.

Definition at line 874 of file cmtkCommandLine.h.


Member Typedef Documentation

Smart pointer.

Reimplemented from cmtk::CommandLine::KeyToAction.

Definition at line 883 of file cmtkCommandLine.h.

Superclass.

Definition at line 880 of file cmtkCommandLine.h.


Constructor & Destructor Documentation

cmtk::CommandLine::KeyToActionEnum::KeyToActionEnum ( const Key key,
EnumGroupBase::SmartPtr  keyToActionEnum,
const std::string &  comment 
) [inline]

Constructor for enumeration parameter group.

An enumeration parameter group is a group of parameters that all modify the same variable by setting it to different values. There is one command line parameter (i.e., key/action pair) per value, plus a group parameter, which sets the variable based on the name of one of the supported values.

Parameters:
keyKey: long and/or short command line option for this action.
keyToActionEnumThe definition of the enumeration keys and values.
commentCommand line help comment for this action.

Definition at line 891 of file cmtkCommandLine.h.

virtual cmtk::CommandLine::KeyToActionEnum::~KeyToActionEnum (  ) [inline, virtual]

Virtual destructor.

Definition at line 899 of file cmtkCommandLine.h.


Member Function Documentation

mxml_node_t * cmtk::CommandLine::KeyToActionEnum::MakeXML ( mxml_node_t *const   parent ) const [virtual]

Returns an XML tree describing this key and action.

Parameters:
parentParent in the XML tree for the new node.

Reimplemented from cmtk::CommandLine::KeyToAction.

Definition at line 91 of file cmtkCommandLineKeyToActionEnum.cxx.

References NULL.

bool cmtk::CommandLine::KeyToActionEnum::MatchAndExecute ( const char  keyChar,
const size_t  argc,
const char *  argv[],
size_t &  index 
) [virtual]

Test short key from command line and execute if match.

Parameters:
keyCharKey (long option) from the command line.
argcTotal number of command line arguments.
argvCommand line argument list.
indexCurrent index in command line list

Implements cmtk::CommandLine::KeyToAction.

Definition at line 149 of file cmtkCommandLineKeyToActionEnum.cxx.

bool cmtk::CommandLine::KeyToActionEnum::MatchAndExecute ( const std::string &  key,
const size_t  argc,
const char *  argv[],
size_t &  index 
) [virtual]

Test long key from command line and execute if match.

Parameters:
keyKey (long option) from the command line.
argcTotal number of command line arguments.
argvCommand line argument list.
indexCurrent index in command line list

Implements cmtk::CommandLine::KeyToAction.

Definition at line 113 of file cmtkCommandLineKeyToActionEnum.cxx.

void cmtk::CommandLine::KeyToActionEnum::PrintHelp ( const size_t  globalIndent = 0 ) const [virtual]
void cmtk::CommandLine::KeyToActionEnum::PrintWikiWithPrefix ( const std::string &  prefix = "" ) const [virtual]

Print help for this item in Wiki markup.

Reimplemented from cmtk::CommandLine::KeyToAction.

Definition at line 65 of file cmtkCommandLineKeyToActionEnum.cxx.

References cmtk::StdOut.


Friends And Related Function Documentation

friend class EnumGroupBase [friend]

Give enum group class full access.

Definition at line 930 of file cmtkCommandLine.h.


Member Data Documentation

For enum parameter group, list of subkeys and action.

Definition at line 927 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