Template Numerical Library: TNL::Config::ParameterContainer Class Reference

Template Numerical Library version\ main:c7077e4fd

Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
TNL::Config::ParameterContainer Class Reference
Collaboration diagram for TNL::Config::ParameterContainer:
[legend]

## Public Member Functions
template<class T>
void | addList (const std::string &name, const std::vector< T > &value)
| Adds new list parameter to the ParameterContainer.
template<class T, class... Ts>
void | addList (const std::string &name, const T &value, const Ts &... values)
| Adds new list parameter to the ParameterContainer.
template<class T>
void | addParameter (const std::string &name, const std::vector< T > &value)
| Adds new parameter to the ParameterContainer.
template<class T>
void | addParameter (const std::string &name, const T &value)
| Adds new parameter to the ParameterContainer.
bool | checkParameter (const std::string &name) const
| Checks if the ParameterContainer contains a parameter specified by its name.
bool | checkParameters (std::initializer_list< std::string > names) const
| Checks if the ParameterContainer contains all specified parameter names.
template<class T>
bool | checkParameterType (const std::string &name) const
| Checks if the parameter name already exists in ParameterContainer and holds a value of type T.
template<class T>
std::vector< T > | getList (const std::string &name) const
| Returns parameter list.
template<class T>
T | getParameter (const std::string &name) const
| Returns parameter value.
template<class StaticArray>
StaticArray | getXyz (const std::string &prefix) const
| Returns up to three parameter values as a StaticArray.
template<class T>
void | setParameter (const std::string &name, const T &value)
| Assigns new value to the parameter name.

## Protected Attributes
std::unordered_map< std::string, Parameter > | parameters

## Member Function Documentation

## ◆ addList() [1/2]

template<class T>

void TNL::Config::ParameterContainer::addList | ( | const std::string & | name,
|  | const std::vector< T > & | value )
| inline

Adds new list parameter to the ParameterContainer.

Parameters

  name | Name of the new parameter.
  value | Vector of values assigned to the parameter.

## ◆ addList() [2/2]

template<class T, class... Ts>

void TNL::Config::ParameterContainer::addList | ( | const std::string & | name,
|  | const T & | value,
|  | const Ts &... | values )
| inline

Adds new list parameter to the ParameterContainer.

Parameters

  name | Name of the new parameter.
  value | First value assigned to the parameter.
  values | Other values assigned to the parameter.

## ◆ addParameter() [1/2]

template<class T>

void TNL::Config::ParameterContainer::addParameter | ( | const std::string & | name,
|  | const std::vector< T > & | value )
| inline

Adds new parameter to the ParameterContainer.

Parameters

  name | Name of the new parameter.
  value | Value assigned to the parameter.

## ◆ addParameter() [2/2]

template<class T>

void TNL::Config::ParameterContainer::addParameter | ( | const std::string & | name,
|  | const T & | value )
| inline

Adds new parameter to the ParameterContainer.

Parameters

  name | Name of the new parameter.
  value | Value assigned to the parameter.

## ◆ checkParameter()

bool TNL::Config::ParameterContainer::checkParameter | ( | const std::string & | name | ) | const
| inlinenodiscard

Checks if the ParameterContainer contains a parameter specified by its name.

Parameters

  name | Name of the parameter.

## ◆ checkParameters()

bool TNL::Config::ParameterContainer::checkParameters | ( | std::initializer_list< std::string > | names | ) | const
| inlinenodiscard

Checks if the ParameterContainer contains all specified parameter names.

Parameters

  names | List of the parameter names.

## ◆ checkParameterType()

template<class T>

bool TNL::Config::ParameterContainer::checkParameterType | ( | const std::string & | name | ) | const
| inlinenodiscard

Checks if the parameter name already exists in ParameterContainer and holds a value of type T.

Parameters

  name | Name of the parameter.

## ◆ getList()

template<class T>

std::vector< T > TNL::Config::ParameterContainer::getList | ( | const std::string & | name | ) | const
| inlinenodiscard

Returns parameter list.

Parameters

  name | Name of the parameter list.

## ◆ getParameter()

template<class T>

T TNL::Config::ParameterContainer::getParameter | ( | const std::string & | name | ) | const
| inlinenodiscard

Returns parameter value.

Parameters

  name | Name of the parameter.

## ◆ getXyz()

template<class StaticArray>

StaticArray TNL::Config::ParameterContainer::getXyz | ( | const std::string & | prefix | ) | const
| inlinenodiscard

Returns up to three parameter values as a StaticArray.

Parameters

  prefix | Prefix of the parameter names. The names are prefix-x, prefix-y and prefix-z.

## ◆ setParameter()

template<class T>

void TNL::Config::ParameterContainer::setParameter | ( | const std::string & | name,
|  | const T & | value )
| inline

Assigns new value to the parameter name.

Template Parameters

  T | Type of the parameter value.

Parameters

  name | Name of parameter.
  value | Value of type T assigned to the parameter.

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

- src/TNL/Config/ParameterContainer.h