IPPL API Reference
Independent Parallel Particle Layer C++ API
Loading...
Searching...
No Matches
ippl::ParameterList Class Reference

Public Types

using variant_t = std::variant< double, float, bool, std::string, unsigned int, int, ParameterList >
 

Public Member Functions

 ParameterList (const ParameterList &)=default
 
template<typename T >
void add (const std::string &key, const T &value)
 
template<typename T >
get (const std::string &key) const
 
template<typename T >
get (const std::string &key, const T &defval) const
 
void merge (const ParameterList &p) noexcept
 
void update (const ParameterList &p) noexcept
 
template<typename T >
void update (const std::string &key, const T &value)
 
ParameterListoperator= (const ParameterList &other)
 

Protected Attributes

std::map< std::string, variant_t > params_m
 

Friends

template<class Stream >
Stream & operator<< (Stream &stream, const ParameterList &sp)
 
std::ostream & operator<< (std::ostream &os, const ParameterList &sp)
 

Member Function Documentation

◆ add()

template<typename T >
void ippl::ParameterList::add ( const std::string &  key,
const T &  value 
)
inline

Add a single parameter to this list.

Parameters
keyis the name of the parameter
valueis the parameter value

◆ get() [1/2]

template<typename T >
T ippl::ParameterList::get ( const std::string &  key) const
inline

Obtain the value of a parameter. This function throws an error if the key is not contained.

Parameters
keythe name of the parameter
Returns
the value of a parameter

◆ get() [2/2]

template<typename T >
T ippl::ParameterList::get ( const std::string &  key,
const T &  defval 
) const
inline

Obtain the value of a parameter. If the key is not contained, the default value is returned.

Parameters
keythe name of the parameter
defvalthe default value of the parameter
Returns
the value of a parameter

◆ merge()

void ippl::ParameterList::merge ( const ParameterList p)
inlinenoexcept

Merge a parameter list into this parameter list.

Parameters
pthe parameter list to merge into this

◆ update() [1/2]

void ippl::ParameterList::update ( const ParameterList p)
inlinenoexcept

Update the parameter values of this list with the values provided in the input parameter list.

Parameters
pthe input parameter list with update parameter values

◆ update() [2/2]

template<typename T >
void ippl::ParameterList::update ( const std::string &  key,
const T &  value 
)
inline

Update the single parameter value of this list.

Parameters
keyis the name of the parameter
valueis the parameter value

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const ParameterList sp 
)
friend

Print this parameter list.


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