Template Numerical Library version\ main:94209208
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
TNL::Config::ParameterContainer Class Reference
Collaboration diagram for TNL::Config::ParameterContainer:
Collaboration graph
[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 >
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
nameName of the new parameter.
valueVector 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
nameName of the new parameter.
valueFirst value assigned to the parameter.
valuesOther 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
nameName of the new parameter.
valueValue 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
nameName of the new parameter.
valueValue assigned to the parameter.

◆ checkParameter()

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

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

Parameters
nameName of the parameter.

◆ checkParameters()

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

Checks if the ParameterContainer contains all specified parameter names.

Parameters
namesList of the parameter names.

◆ checkParameterType()

template<class T >
bool TNL::Config::ParameterContainer::checkParameterType ( const std::string & name) const
inline

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

Parameters
nameName of the parameter.

◆ getList()

template<class T >
std::vector< T > TNL::Config::ParameterContainer::getList ( const std::string & name) const
inline

Returns parameter list.

Parameters
nameName of the parameter list.

◆ getParameter()

template<class T >
T TNL::Config::ParameterContainer::getParameter ( const std::string & name) const
inline

Returns parameter value.

Parameters
nameName of the parameter.

◆ getXyz()

template<class StaticArray >
StaticArray TNL::Config::ParameterContainer::getXyz ( const std::string & prefix) const
inline

Returns up to three parameter values as a StaticArray.

Parameters
prefixPrefix 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
TType of the parameter value.
Parameters
nameName of parameter.
valueValue of type T assigned to the parameter.

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