Skip to content

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.

Paramita::ParameterSpace::ParameterSpace () = default


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.

Paramita::ParameterSpace::add_parameter (
    const std::string & name,
    const Parameter & param
) 

Parameters:

  • name The identifier for the parameter to be added or retrieved.
  • param An instance of Parameter representing the new parameter. Defaults to an empty parameter if not specified.

Exception:

  • std::invalid_argument If a parameter with this name already exists.

function all_parameters

Get all the valid parameters from this space.

std::vector< std::string > Paramita::ParameterSpace::all_parameters () 

Returns:

The parameters' names.


function get_parameter

Get the parameter with this name.

const Parameter & Paramita::ParameterSpace::get_parameter (
    const std::string & name
) 

Parameters:

  • name The name of the parameter to retrieve.

Returns:

The parameter identified by the name.

Exception:

  • std::invalid_argument If no parameter with this name exists.