Parfis
v0.0.7
|
Class is used as a base class. More...
#include <datastruct.h>
Public Member Functions | |
Domain (const std::string &dname, Logger &logger, CfgData &cfgData, SimData &simData, std::map< std::string, std::unique_ptr< CommandChain >> &cmdChainMap) | |
Domain (const Domain &)=default | |
Domain & | operator= (const Domain &)=default |
parfis::Param< std::string > * | getParent (const std::string &cstr) |
int | initialize (const std::string &cstr) |
Initializes Domain from DEFAULT_INITIALIZATION_STRING. More... | |
int | configure (const std::string &cstr) |
Configures initialized Domain. More... | |
virtual int | loadCfgData ()=0 |
virtual int | loadSimData ()=0 |
template<class T > | |
int | getParamToValue (const std::string &key, T &valRef) |
Sets the first value of the Param<T>::m_valueVec. More... | |
template<class T > | |
void | getParamToVector (const std::string &key, std::vector< T > &vecRef) |
Sets the values of Param<T>::m_valueVec to a vector. More... | |
template<> | |
int | getParamToValue (const std::string &key, Vec3D< double > &valRef) |
Specialization for Vec3D<double> More... | |
template<> | |
int | getParamToValue (const std::string &key, Vec3D< int > &valRef) |
Specialization for Vec3D<int> More... | |
![]() | |
void | setValueVec (const std::string &valstr) |
void | setValueVec (const std::string &valstr) |
void | setValueVec (const std::string &valstr) |
void | setValueVec (const std::string &valstr) |
![]() | |
std::string | getValueString (bool printType=false) |
template<class S > | |
void | addChild (const std::string &name) |
Static Public Member Functions | |
static std::unique_ptr< Domain > | generateDomain (const std::string &dname, Logger &logger, CfgData &cfgData, SimData &simData, std::map< std::string, std::unique_ptr< CommandChain >> &cmdChainMap) |
Generates new domain based on dname. More... | |
![]() | |
static void | setValueVec (ParamBase *ppb, const std::string &valstr) |
Public Attributes | |
Logger * | m_pLogger |
Pointer to the Logger object from parfis. | |
CfgData * | m_pCfgData |
Pointer to configuration data. | |
SimData * | m_pSimData |
Pointer to simulation data. | |
std::map< std::string, std::unique_ptr< CommandChain > > * | m_pCmdChainMap |
Pointer to command map. | |
![]() | |
std::vector< std::string > | m_valueVec |
Vector of parameter values. | |
![]() | |
std::string | m_name |
std::string | m_type |
size_t | m_size |
ParamBase * | m_parent |
std::map< std::string, std::unique_ptr< ParamBase > > | m_childMap |
Map of children ParamBase objects (functions as a data containter) | |
Class is used as a base class.
Objects used in the Parfis class, are objects from classes that inherit Domain. Domain is used as an abstract class to have its functionality exposed to the API, along with the speciffic functionalities of its children.
int parfis::Domain::configure | ( | const std::string & | cstr | ) |
Configures initialized Domain.
cstr | configuration string is in the format key=value |
|
static |
Generates new domain based on dname.
dname | domain name one of predefined ("system", "particle") |
logger | reference to the logger of the Parfis object |
cfgData | reference to the CfgData object from the Parfis object |
simData | reference to the SimData object from the Parfis object |
cmdChainMap | reference to the command map from the Parfis object |
template int parfis::Domain::getParamToValue< double > | ( | const std::string & | key, |
T & | valRef | ||
) |
Sets the first value of the Param<T>::m_valueVec.
T | type of parameter (double, float, int or string) |
key | name of the parameter without the first, domain, name level. |
valRef | reference to set value to |
int parfis::Domain::getParamToValue | ( | const std::string & | key, |
Vec3D< double > & | valRef | ||
) |
Specialization for Vec3D<double>
key | name of the parameter without the first, domain, name level. |
valRef | reference to set value to |
int parfis::Domain::getParamToValue | ( | const std::string & | key, |
Vec3D< int > & | valRef | ||
) |
Specialization for Vec3D<int>
key | name of the parameter without the first, domain, name level. |
valRef | reference to set value to |
template void parfis::Domain::getParamToVector< double > | ( | const std::string & | key, |
std::vector< T > & | vecRef | ||
) |
Sets the values of Param<T>::m_valueVec to a vector.
T | type of parameter (double, float, int or string) |
key | name of the parameter without the first, domain, name level. |
vecRef | reference of a vector to set values to |
int parfis::Domain::initialize | ( | const std::string & | cstr | ) |
Initializes Domain from DEFAULT_INITIALIZATION_STRING.
cstr | initialization string is in the format key=value<type>(range). Value can be of type array in which case is given as [value1, value2, ...]. |