OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
ippl::ParameterList Class Reference

#include <ParameterList.h>

Collaboration diagram for ippl::ParameterList:
Collaboration graph

Public Types

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

Public Member Functions

 ParameterList ()=default
 
 ParameterList (const ParameterList &)=default
 
template<typename T >
void add (const std::string &key, const T &value)
 
template<typename T >
T get (const std::string &key) const
 
template<typename T >
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_tparams_m
 

Friends

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

Detailed Description

Definition at line 29 of file ParameterList.h.

Member Typedef Documentation

◆ variant_t

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

Definition at line 32 of file ParameterList.h.

Constructor & Destructor Documentation

◆ ParameterList() [1/2]

ippl::ParameterList::ParameterList ( )
default

◆ ParameterList() [2/2]

ippl::ParameterList::ParameterList ( const ParameterList )
default

Member Function Documentation

◆ add()

◆ get() [1/2]

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

◆ 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

Definition at line 75 of file ParameterList.h.

References params_m.

◆ merge()

◆ operator=()

ParameterList & ippl::ParameterList::operator= ( const ParameterList other)
inline

Definition at line 164 of file ParameterList.h.

References params_m.

◆ update() [1/2]

◆ 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

Definition at line 111 of file ParameterList.h.

References params_m.

Friends And Related Function Documentation

◆ operator<< [1/2]

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

Print this parameter list.

Definition at line 137 of file ParameterList.h.

◆ operator<< [2/2]

template<class Stream >
Stream & operator<< ( Stream &  stream,
const ParameterList sp 
)
friend

Definition at line 120 of file ParameterList.h.

Member Data Documentation

◆ params_m

std::map<std::string, variant_t> ippl::ParameterList::params_m
protected

Definition at line 173 of file ParameterList.h.

Referenced by add(), get(), merge(), operator=(), and update().


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