Class Paramita::ParameterSpace¶
Manages a collection of parameters, each identified by a unique name.
#include <ParameterSpace.hpp>
Public Functions¶
| Type | Name |
|---|---|
| ParameterSpace () = default Creates an empty parameter space. |
|
| ParameterSpace (const std::unordered_map< std::string, const Parameter & > & params) Creates a parameter space with the provided parameters. |
|
| add_parameter (const std::string & name, const Parameter & param) Define a new parameter in this parameter space. |
|
| std::vector< std::string > | all_parameters () Get all the valid parameters from this space. |
| const Parameter & | get_parameter (const std::string & name) Get the parameter with this name. |
Public Functions Documentation¶
function ParameterSpace [1/2]¶
Creates an empty parameter space.
function ParameterSpace [2/2]¶
Creates a parameter space with the provided parameters.
explicit Paramita::ParameterSpace::ParameterSpace (
const std::unordered_map< std::string, const Parameter & > & params
)
function add_parameter¶
Define a new parameter in this parameter space.
Parameters:
nameThe identifier for the parameter to be added or retrieved.paramAn instance of Parameter representing the new parameter. Defaults to an empty parameter if not specified.
Exception:
std::invalid_argumentIf a parameter with this name already exists.
function all_parameters¶
Get all the valid parameters from this space.
Returns:
The parameters' names.
function get_parameter¶
Get the parameter with this name.
Parameters:
nameThe name of the parameter to retrieve.
Returns:
The parameter identified by the name.
Exception:
std::invalid_argumentIf no parameter with this name exists.