Parfis  v0.0.7
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
parfis::Domain Struct Referenceabstract

Class is used as a base class. More...

#include <datastruct.h>

Inheritance diagram for parfis::Domain:
parfis::Param< std::string > parfis::ParamBase parfis::Particle parfis::System

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
 
Domainoperator= (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...
 
- Public Member Functions inherited from parfis::Param< std::string >
void setValueVec (const std::string &valstr)
 
void setValueVec (const std::string &valstr)
 
void setValueVec (const std::string &valstr)
 
void setValueVec (const std::string &valstr)
 
- Public Member Functions inherited from parfis::ParamBase
std::string getValueString (bool printType=false)
 
template<class S >
void addChild (const std::string &name)
 

Static Public Member Functions

static std::unique_ptr< DomaingenerateDomain (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 Public Member Functions inherited from parfis::ParamBase
static void setValueVec (ParamBase *ppb, const std::string &valstr)
 

Public Attributes

Loggerm_pLogger
 Pointer to the Logger object from parfis.
 
CfgDatam_pCfgData
 Pointer to configuration data.
 
SimDatam_pSimData
 Pointer to simulation data.
 
std::map< std::string, std::unique_ptr< CommandChain > > * m_pCmdChainMap
 Pointer to command map.
 
- Public Attributes inherited from parfis::Param< std::string >
std::vector< std::string > m_valueVec
 Vector of parameter values.
 
- Public Attributes inherited from parfis::ParamBase
std::string m_name
 
std::string m_type
 
size_t m_size
 
ParamBasem_parent
 
std::map< std::string, std::unique_ptr< ParamBase > > m_childMap
 Map of children ParamBase objects (functions as a data containter)
 

Detailed Description

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.

Member Function Documentation

◆ configure()

int parfis::Domain::configure ( const std::string &  cstr)

Configures initialized Domain.

Parameters
cstrconfiguration string is in the format key=value
Returns
Zero on success

◆ generateDomain()

std::unique_ptr< parfis::Domain > parfis::Domain::generateDomain ( const std::string &  dname,
Logger logger,
CfgData cfgData,
SimData simData,
std::map< std::string, std::unique_ptr< CommandChain >> &  cmdChainMap 
)
static

Generates new domain based on dname.

Parameters
dnamedomain name one of predefined ("system", "particle")
loggerreference to the logger of the Parfis object
cfgDatareference to the CfgData object from the Parfis object
simDatareference to the SimData object from the Parfis object
cmdChainMapreference to the command map from the Parfis object
Returns
Domain created with new

◆ getParamToValue() [1/3]

template<class T >
template int parfis::Domain::getParamToValue< double > ( const std::string &  key,
T &  valRef 
)

Sets the first value of the Param<T>::m_valueVec.

Template Parameters
Ttype of parameter (double, float, int or string)
Parameters
keyname of the parameter without the first, domain, name level.
valRefreference to set value to
Returns
int zero on success

◆ getParamToValue() [2/3]

template<>
int parfis::Domain::getParamToValue ( const std::string &  key,
Vec3D< double > &  valRef 
)

Specialization for Vec3D<double>

Parameters
keyname of the parameter without the first, domain, name level.
valRefreference to set value to
Returns
int zero on success

◆ getParamToValue() [3/3]

template<>
int parfis::Domain::getParamToValue ( const std::string &  key,
Vec3D< int > &  valRef 
)

Specialization for Vec3D<int>

Parameters
keyname of the parameter without the first, domain, name level.
valRefreference to set value to
Returns
int zero on success

◆ getParamToVector()

template<class T >
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.

Template Parameters
Ttype of parameter (double, float, int or string)
Parameters
keyname of the parameter without the first, domain, name level.
vecRefreference of a vector to set values to

◆ initialize()

int parfis::Domain::initialize ( const std::string &  cstr)

Initializes Domain from DEFAULT_INITIALIZATION_STRING.

Parameters
cstrinitialization string is in the format key=value<type>(range). Value can be of type array in which case is given as [value1, value2, ...].
Returns
Zero on success