Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Euclid::Configuration::ProgramOptionsHelper Class Reference

Class providing some helper methods for managing boost program options. More...

#include <ProgramOptionsHelper.h>

Public Member Functions

virtual ~ProgramOptionsHelper ()=default
 Destructor.
 

Static Public Member Functions

static std::string wildcard (const std::string &name, const std::string &instance="*")
 Creates the name to use for a wildcard program option.
 
static std::set< std::stringfindWildcardNames (const std::vector< std::string > &option_name_list, const std::map< std::string, boost::program_options::variable_value > &options)
 Returns the instance names of wildcard options.
 

Detailed Description

Class providing some helper methods for managing boost program options.

Definition at line 40 of file ProgramOptionsHelper.h.

Constructor & Destructor Documentation

◆ ~ProgramOptionsHelper()

virtual Euclid::Configuration::ProgramOptionsHelper::~ProgramOptionsHelper ( )
virtualdefault

Destructor.

Member Function Documentation

◆ findWildcardNames()

std::set< std::string > Euclid::Configuration::ProgramOptionsHelper::findWildcardNames ( const std::vector< std::string > &  option_name_list,
const std::map< std::string, boost::program_options::variable_value > &  options 
)
static

Returns the instance names of wildcard options.

This method searches for all wildcard options in the option_name_list and it returns the instance names to be used with the wildcard() method for retrieving the option value from a boost variables_map.

Parameters
option_name_listThe list of the wildcard options to search for
optionsThe map with the values of the user
Returns
The instance names

Definition at line 36 of file ProgramOptionsHelper.cpp.

References std::set< K >::insert().

Here is the call graph for this function:

◆ wildcard()

std::string Euclid::Configuration::ProgramOptionsHelper::wildcard ( const std::string name,
const std::string instance = "*" 
)
static

Creates the name to use for a wildcard program option.

This method has two usages. If is is called with only the name parameter, it returns the name of the option as it should be appended to the boost option_description when describing the option. If it is called with an instance name, it returns the name to be used for retrieving the option value from the boost variables_map. The names of the instances can be retrieved by using the findWildcardNames() method.

Parameters
nameThe name of the wildcard option
instanceThe name of the instance
Returns
The wildcard option name

Definition at line 31 of file ProgramOptionsHelper.cpp.


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