Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
LUPI::OptionCounter Class Reference

#include <LUPI.hpp>

Inheritance diagram for LUPI::OptionCounter:

Public Member Functions

 OptionCounter (std::string const &a_name, std::string const &a_descriptor="", int a_minimumNeeded=0, int a_maximumNeeded=-1)
 ~OptionCounter ()
std::string printStatus2 () const
Public Member Functions inherited from LUPI::ArgumentBase
 ArgumentBase (ArgumentType a_argumentType, std::string const &a_name, std::string const &a_descriptor, int a_minimumNeeded, int a_maximumNeeded)
virtual ~ArgumentBase ()=0
ArgumentType argumentType () const
std::string const & name () const
std::vector< std::string > const & names ()
bool hasName (std::string const &a_name) const
std::string const & descriptor () const
int minimumNeeded () const
int maximumNeeded () const
std::size_t counts () const
virtual std::string const & value (std::size_t a_index=0) const
std::vector< std::string > const & values () const
virtual bool isOptionalArgument () const
virtual bool requiresAValue () const
virtual int parse (ArgumentParser const &a_argumentParser, int a_index, int a_argc, char **a_argv)
std::string usage (bool a_requiredOption) const
void printStatus (std::string a_indent) const

Detailed Description

An optional argument that counts the number of times the option is entered.

Definition at line 276 of file LUPI.hpp.

Constructor & Destructor Documentation

◆ OptionCounter()

LUPI::OptionCounter::OptionCounter ( std::string const & a_name,
std::string const & a_descriptor = "",
int a_minimumNeeded = 0,
int a_maximumNeeded = -1 )

OptionCounter constructor.

Parameters
a_name[in] The name of the argument.
a_descriptor[in] The string printed with arugment's help.
a_minimumNeeded[in] Not used. Will probably be deprecated.
a_maximumNeeded[in] Not used. Will probably be deprecated.

Definition at line 327 of file LUPI_argumentParser.cc.

327 :
328 ArgumentBase( ArgumentType::Count, a_name, a_descriptor, 0, -1 ) {
329
330}
ArgumentBase(ArgumentType a_argumentType, std::string const &a_name, std::string const &a_descriptor, int a_minimumNeeded, int a_maximumNeeded)

◆ ~OptionCounter()

LUPI::OptionCounter::~OptionCounter ( )
inline

Definition at line 280 of file LUPI.hpp.

280{ }

Member Function Documentation

◆ printStatus2()

std::string LUPI::OptionCounter::printStatus2 ( ) const
virtual

Called by printStatus. This method returns a string representing this's value.

Reimplemented from LUPI::ArgumentBase.

Definition at line 336 of file LUPI_argumentParser.cc.

336 {
337
338 return( " counts = " + std::to_string( counts( ) ) );
339}
std::size_t counts() const
Definition LUPI.hpp:214
std::string to_string(G4FermiAtomicMass mass)

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