allpix::OptionParser

Module: Managers

Option parser responsible for parsing and caching command line arguments. More…

#include <OptionParser.hpp>

Public Functions

Name
OptionParser(const OptionParser & ) =delete
Copying the option parser is not allowed.
OptionParser & operator=(const OptionParser & ) =delete
Copying the option parser is not allowed.
OptionParser(OptionParser && ) =default
Use default move behaviour.
OptionParser & operator=(OptionParser && ) =default
Use default move behaviour.
OptionParser() =default
Use default constructor.
~OptionParser() =default
Use default destructor.
void parseOption(std::string line)
Parse an extra configuration option.
bool applyGlobalOptions(Configuration & config)
Apply all global options to a given global configuration object.
bool applyOptions(const std::string & identifier, Configuration & config)
Apply all relevant options to the given configuration object.

Detailed Description

class allpix::OptionParser;

Option parser responsible for parsing and caching command line arguments.

The option parser stores additional configuration items provided via the command line interface for later reference, since most of the parameters can only be applied once all modules have been instantiated.

Public Functions Documentation

function OptionParser

OptionParser(
    const OptionParser & 
) =delete

Copying the option parser is not allowed.

function operator=

OptionParser & operator=(
    const OptionParser & 
) =delete

Copying the option parser is not allowed.

function OptionParser

OptionParser(
    OptionParser && 
) =default

Use default move behaviour.

function operator=

OptionParser & operator=(
    OptionParser && 
) =default

Use default move behaviour.

function OptionParser

OptionParser() =default

Use default constructor.

function ~OptionParser

~OptionParser() =default

Use default destructor.

function parseOption

void parseOption(
    std::string line
)

Parse an extra configuration option.

Parameters:

  • line Line with the option

Option is split in a key / value pair, an error is thrown if that is not possible. When the key contains at least one dot it is interpreted as a relative configuration with the module / detector identified by the first dot. In that case the option is applied during loading when either the unique or the configuration name match. Otherwise the key is interpreted as global key and is added to the global header.

function applyGlobalOptions

bool applyGlobalOptions(
    Configuration & config
)

Apply all global options to a given global configuration object.

Parameters:

  • config Global configuration option to which the options should be applied to

Return: True if new global configuration options were applied

function applyOptions

bool applyOptions(
    const std::string & identifier,
    Configuration & config
)

Apply all relevant options to the given configuration object.

Parameters:

  • identifier Identifier to select the options to apply
  • config Configuration option to which the options should be applied to

Return: True if the configuration was changed because of applied options


Updated on 2025-02-27 at 14:14:46 +0000