MarlinMT  0.1.0
marlinmt::CmdLineParser Class Reference

CmdLineParser class Does the main command line parsing for MarlinMT. More...

#include <CmdLineParser.h>

Classes

struct  ParseResult
 ParseResult struct. The result of the command line parsing. More...
 

Public Types

using AdditionalArgs = std::map< std::string, std::string >
 

Public Member Functions

 CmdLineParser ()=default
 Default constructor. More...
 
 ~CmdLineParser ()=default
 Default destructor. More...
 
void setOptionalArgs (bool opt=true)
 Set all cmd line arguments to optional during parsing. More...
 
std::vector< std::string > getStandardOptions () const
 Get all possible command options (short and long options) More...
 
ParseResult parse (int argc, char **argv)
 Parse the command line. More...
 

Private Attributes

bool _optionalArgs {false}
 Whether all arguments are optional. More...
 

Detailed Description

CmdLineParser class Does the main command line parsing for MarlinMT.

Definition at line 14 of file CmdLineParser.h.

Member Typedef Documentation

◆ AdditionalArgs

using marlinmt::CmdLineParser::AdditionalArgs = std::map<std::string, std::string>

Definition at line 16 of file CmdLineParser.h.

Constructor & Destructor Documentation

◆ CmdLineParser()

marlinmt::CmdLineParser::CmdLineParser ( )
default

Default constructor.

◆ ~CmdLineParser()

marlinmt::CmdLineParser::~CmdLineParser ( )
default

Default destructor.

Member Function Documentation

◆ getStandardOptions()

std::vector< std::string > marlinmt::CmdLineParser::getStandardOptions ( ) const

Get all possible command options (short and long options)

Definition at line 81 of file CmdLineParser.cc.

◆ parse()

CmdLineParser::ParseResult marlinmt::CmdLineParser::parse ( int  argc,
char **  argv 
)

Parse the command line.

Parameters
argcthe number of arguments
argvthe full argument list

Definition at line 90 of file CmdLineParser.cc.

References marlinmt::CmdLineParser::ParseResult::_arguments, MARLINMT_RELEASE, MARLINMT_THROW, and marlinmt::details::nthreads().

Referenced by marlinmt::Application::init().

◆ setOptionalArgs()

void marlinmt::CmdLineParser::setOptionalArgs ( bool  opt = true)

Set all cmd line arguments to optional during parsing.

Parameters
optinput flag

Definition at line 75 of file CmdLineParser.cc.

Member Data Documentation

◆ _optionalArgs

bool marlinmt::CmdLineParser::_optionalArgs {false}
private

Whether all arguments are optional.

Definition at line 62 of file CmdLineParser.h.


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