SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
Public Member Functions | Private Attributes | List of all members
CommandLineOption Class Reference

Command-line option with a single letter, full name and description plus an associated Geant4 command (which is optional). More...

#include <CommandLineOption.hh>

Public Member Functions

 CommandLineOption (const std::string &shortname, const std::string &longname, const std::string &description, unsigned int minArgs=0, unsigned int maxArgs=0, const std::string &macroCommand="")
 
virtual ~CommandLineOption ()
 
const std::string & getDescription () const
 
const std::string & getG4CommandString () const
 
const std::string & getLongName () const
 
unsigned int getMaxArgs () const
 
unsigned int getMinArgs () const
 
const std::string & getShortName () const
 

Private Attributes

std::string m_description
 
std::string m_g4cmdstr
 
std::string m_longname
 
int m_maxArgs
 
int m_minArgs
 
std::string m_shortname
 

Detailed Description

Command-line option with a single letter, full name and description plus an associated Geant4 command (which is optional).

Author
Jeremy McCormick jerem.nosp@m.ym@s.nosp@m.lac.s.nosp@m.tanf.nosp@m.ord.e.nosp@m.du

Definition at line 17 of file CommandLineOption.hh.

Constructor & Destructor Documentation

◆ CommandLineOption()

CommandLineOption ( const std::string &  shortname,
const std::string &  longname,
const std::string &  description,
unsigned int  minArgs = 0,
unsigned int  maxArgs = 0,
const std::string &  macroCommand = "" 
)
inline

The fully qualified constructor for CommandLineOption.

Parameters
[in]shortnameThe single letter command switch.
[in]longnameThe longer name of the command.
[in]minArgsThe minimum number of arguments.
[in]maxArgsThe maximum number of arguments.
[in]macroCommandThe corresponding Geant4 macro string.

Definition at line 29 of file CommandLineOption.hh.

◆ ~CommandLineOption()

virtual ~CommandLineOption ( )
inlinevirtual

Class destructor.

Definition at line 46 of file CommandLineOption.hh.

Member Function Documentation

◆ getDescription()

const std::string& getDescription ( ) const
inline

Get a brief description of this option.

Returns
A description of the option.

Definition at line 74 of file CommandLineOption.hh.

References CommandLineOption::m_description.

Referenced by CommandLineProcessor::printOptions().

◆ getG4CommandString()

const std::string& getG4CommandString ( ) const
inline

Get the Geant4 command associated with this option. This may be a null string if there is no associated Geant4 command, though currently all of SLIC's options have a corresponding macro.

Returns
The Geant4 command string for the option.

Definition at line 85 of file CommandLineOption.hh.

References CommandLineOption::m_g4cmdstr.

Referenced by CommandLineProcessor::printOptions(), and CommandLineProcessor::processOption().

◆ getLongName()

const std::string& getLongName ( ) const
inline

Get the long name associated with this option. This must be one or more words separated by dashes, such as "lcio-path".

Returns
The long name of the command.

Definition at line 66 of file CommandLineOption.hh.

References CommandLineOption::m_longname.

Referenced by CommandLineProcessor::printOptions().

◆ getMaxArgs()

unsigned int getMaxArgs ( ) const
inline

Get the maximum number of arguments to this option.

Returns
The maximum number of arguments.

Definition at line 101 of file CommandLineOption.hh.

References CommandLineOption::m_maxArgs.

Referenced by CommandLineProcessor::createOptionsString().

◆ getMinArgs()

unsigned int getMinArgs ( ) const
inline

Get the minimum number of arguments to this option.

Returns
The minimum number of arguments.

Definition at line 93 of file CommandLineOption.hh.

References CommandLineOption::m_minArgs.

Referenced by CommandLineProcessor::createOptionsString().

◆ getShortName()

const std::string& getShortName ( ) const
inline

Get the short name associated with this option. This must be a single letter, such as 'm'.

Returns
The single letter command switch.

Definition at line 56 of file CommandLineOption.hh.

References CommandLineOption::m_shortname.

Referenced by CommandLineProcessor::createOptionsString(), and CommandLineProcessor::printOptions().

Member Data Documentation

◆ m_description

std::string m_description
private

Definition at line 109 of file CommandLineOption.hh.

Referenced by CommandLineOption::getDescription().

◆ m_g4cmdstr

std::string m_g4cmdstr
private

Definition at line 110 of file CommandLineOption.hh.

Referenced by CommandLineOption::getG4CommandString().

◆ m_longname

std::string m_longname
private

Definition at line 108 of file CommandLineOption.hh.

Referenced by CommandLineOption::getLongName().

◆ m_maxArgs

int m_maxArgs
private

Definition at line 112 of file CommandLineOption.hh.

Referenced by CommandLineOption::getMaxArgs().

◆ m_minArgs

int m_minArgs
private

Definition at line 111 of file CommandLineOption.hh.

Referenced by CommandLineOption::getMinArgs().

◆ m_shortname

std::string m_shortname
private

Definition at line 107 of file CommandLineOption.hh.

Referenced by CommandLineOption::getShortName().


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