Steppable 0.0.1
A CAS project written from scratch in C++
Loading...
Searching...
No Matches
steppable::__internals::parameter::ParameterMap Struct Reference

An object containing all parameters and their values passed into a function. More...

#include <parameter.hpp>

Public Member Functions

 ParameterMap (ValueMap values)
 Initializes a new ParameterMap object.
void checkParameterOrder (const std::vector< std::string > &names)
 Checks the presence of all the arguments, in the order which they should be specified. Prints an error message and exits the program if one of the parameter names is not specified according to the order, or the size of the name vector is not the same as the number of parameters passed into the function.
void checkParameterNameUnordered (const std::vector< std::string > &names)
 Checks the presence of all the arguments, no matter which order they are specified. Prints an error message and exits the program if one of the parameter names specified is not found, or the size of the name vector is not the same as the number of parameters passed into the function.
template<typename ValueT>
ValueT getItem (const std::string &name)
 Gets an item from the current parameter map.
template<typename ValueT>
ValueT getItem (const std::string &name, const ValueT &fallback)
 Gets an item from the current parameter map. Returns the fallback the matching parameter if not found.

Public Attributes

ValueMap values
 All ValuedParameter objects passed to a function.

Detailed Description

An object containing all parameters and their values passed into a function.

Constructor & Destructor Documentation

◆ ParameterMap()

steppable::__internals::parameter::ParameterMap::ParameterMap ( ValueMap values)
inline

Initializes a new ParameterMap object.

Parameters
valuesAll ValuedParameter objects passed to a function.

Member Function Documentation

◆ checkParameterNameUnordered()

void steppable::__internals::parameter::ParameterMap::checkParameterNameUnordered ( const std::vector< std::string > & names)

Checks the presence of all the arguments, no matter which order they are specified. Prints an error message and exits the program if one of the parameter names specified is not found, or the size of the name vector is not the same as the number of parameters passed into the function.

Parameters
namesThe names to check.
Here is the call graph for this function:

◆ checkParameterOrder()

void steppable::__internals::parameter::ParameterMap::checkParameterOrder ( const std::vector< std::string > & names)

Checks the presence of all the arguments, in the order which they should be specified. Prints an error message and exits the program if one of the parameter names is not specified according to the order, or the size of the name vector is not the same as the number of parameters passed into the function.

Parameters
namesThe names to check.
Here is the call graph for this function:

◆ getItem() [1/2]

template<typename ValueT>
ValueT steppable::__internals::parameter::ParameterMap::getItem ( const std::string & name)
inline

Gets an item from the current parameter map.

Parameters
nameThe name of the parameter.
Returns
A value from the parameter list.
Here is the call graph for this function:

◆ getItem() [2/2]

template<typename ValueT>
ValueT steppable::__internals::parameter::ParameterMap::getItem ( const std::string & name,
const ValueT & fallback )
inline

Gets an item from the current parameter map. Returns the fallback the matching parameter if not found.

Parameters
nameThe name of the parameter.
fallbackIf no matching parameter is specified, returns the fallback.
Returns
A value from the parameter list or the fallback.

Member Data Documentation

◆ values

ValueMap steppable::__internals::parameter::ParameterMap::values

All ValuedParameter objects passed to a function.


The documentation for this struct was generated from the following files:
Untitled