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

#include <LUPI.hpp>

Inheritance diagram for LUPI::Positional:

Public Member Functions

 Positional (std::string const &a_name, std::string const &a_descriptor="", int a_minimumNeeded=1, int a_maximumNeeded=1)
 ~Positional ()
bool isOptionalArgument () const
bool requiresAValue () const
void printStatus3 (std::string const &a_indent) 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 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 option with a value. If multiple options with the same name are entered, the m_value member will represent the last option entered.

Definition at line 324 of file LUPI.hpp.

Constructor & Destructor Documentation

◆ Positional()

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

Positional constructor.

Parameters
a_name[in] The name of the argument.
a_descriptor[in] The string printed with arugment's help.
a_minimumNeeded[in] The minimum number of times the argument must be entered.
a_maximumNeeded[in] The maximum number of times the argument can be entered.

Definition at line 430 of file LUPI_argumentParser.cc.

430 :
431 ArgumentBase( ArgumentType::Positional, a_name, a_descriptor, a_minimumNeeded, a_maximumNeeded ) {
432}
ArgumentBase(ArgumentType a_argumentType, std::string const &a_name, std::string const &a_descriptor, int a_minimumNeeded, int a_maximumNeeded)

Referenced by Positional().

◆ ~Positional()

LUPI::Positional::~Positional ( )
inline

Definition at line 328 of file LUPI.hpp.

328{ }

Member Function Documentation

◆ isOptionalArgument()

bool LUPI::Positional::isOptionalArgument ( ) const
inlinevirtual

Reimplemented from LUPI::ArgumentBase.

Definition at line 330 of file LUPI.hpp.

330{ return( false ); }

◆ printStatus3()

void LUPI::Positional::printStatus3 ( std::string const & a_indent) const
virtual

Prints the values for this. Called by printStatus.

Parameters
a_indent[in] The amount of indentation to start the first line with.

Reimplemented from LUPI::ArgumentBase.

Definition at line 440 of file LUPI_argumentParser.cc.

440 {
441
442 for( auto valueIterator = values( ).begin( ); valueIterator != values( ).end( ); ++valueIterator ) {
443 std::cout << a_indent << *valueIterator << std::endl;
444 }
445}
std::vector< std::string > const & values() const
Definition LUPI.hpp:217

◆ requiresAValue()

bool LUPI::Positional::requiresAValue ( ) const
inlinevirtual

Reimplemented from LUPI::ArgumentBase.

Definition at line 331 of file LUPI.hpp.

331{ return( true ); }

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