PARTONS  
PARtonic Tomography Of Nucleon Software
Public Member Functions | Private Attributes | List of all members
PARTONS::BaseObjectData Class Reference

Container to store data to be used by base objects. More...

Inheritance diagram for PARTONS::BaseObjectData:
PARTONS::BaseObject

Public Member Functions

 BaseObjectData ()
 Default constructor. More...
 
 BaseObjectData (const std::string &moduleType, const std::string &moduleClassName)
 Assignment constructor. More...
 
virtual ~BaseObjectData ()
 Destructor. More...
 
BaseObjectDataaddSubModule (const std::string &moduleType, const std::string &moduleClassName)
 Add submodule, i.e. More...
 
void addParameter (const ElemUtils::Parameter &parameter)
 Add a single parameter. More...
 
void addParameters (const ElemUtils::Parameters &parameters)
 Add a set of parameters. More...
 
bool isAvailableSubModule (const std::string &moduleClassType) const
 Check if parameters of submodule of a given type are available. More...
 
const BaseObjectDatagetLastAvailable () const
 Get BaseObjectData object indicated by the last call of BaseObjectData::isAvailableSubModule() function. More...
 
virtual std::string toString () const
 Return a pre-formatted characters string for output visualization of class member's values. More...
 
const std::string & getModuleType () const
 Get type of module intended to use parameters stored in this class. More...
 
void setModuleType (const std::string &moduleType)
 Set type of module intended to use parameters stored in this class. More...
 
const std::string & getModuleClassName () const
 Get name of module intended to use parameters stored in this class. More...
 
void setModuleClassName (const std::string &moduleClassName)
 Set name of module intended to use parameters stored in this class. More...
 
const ElemUtils::Parameters & getParameters () const
 Get parameters stored in this class. More...
 
void setParameters (const ElemUtils::Parameters &parameters)
 Set parameters stored in this class. More...
 
const std::map< std::string, BaseObjectData > & getSubModules () const
 Get map to build a tree-like structure of BaseObjectData objects to be used if submodules are used. More...
 
- Public Member Functions inherited from PARTONS::BaseObject
 BaseObject (const std::string &className)
 Constructor. More...
 
virtual ~BaseObject ()
 Default destructor. More...
 
virtual BaseObjectclone () const
 Virtual clone function to allow the factory to clone all derived members object stored in the BaseObjectRegistry. More...
 
virtual void resolveObjectDependencies ()
 Because of the initialization step order of the program, objects are registered in a total random order and some objects depend on others. More...
 
void serialize (ElemUtils::Packet &packet) const
 Used to split a complex C++ object into a concatenation of simple types. More...
 
void unserialize (ElemUtils::Packet &packet)
 Used to rebuild a complex C++ object from a concatenation of simple type. More...
 
bool operator< (const BaseObject &other) const
 Overload of < operator to sort BaseObject object by its indexId value. More...
 
const std::string & getClassName () const
 
unsigned int getObjectId () const
 
int getIndexId () const
 
void setIndexId (int indexId)
 

Private Attributes

std::string m_moduleType
 Type of module intended to use parameters stored in this class. More...
 
std::string m_moduleClassName
 Name of module intended to use parameters stored in this class. More...
 
ElemUtils::Parameters m_parameters
 Parameters stored in this class. More...
 
std::map< std::string, BaseObjectDatam_subModules
 Map to build a tree-like structure of BaseObjectData objects to be used if submodules are used. More...
 
std::map< std::string, BaseObjectData >::const_iterator m_it
 Iterator of BaseObjectData::m_subModules map. More...
 

Additional Inherited Members

- Protected Member Functions inherited from PARTONS::BaseObject
 BaseObject (const BaseObject &other)
 Copy constructor. More...
 
void info (const std::string &functionName, const std::string &message) const
 Print info message into logger. More...
 
void debug (const std::string &functionName, const std::string &message) const
 Print debug message into logger. More...
 
void warn (const std::string &functionName, const std::string &message) const
 Print warning message into logger. More...
 
void errorMissingParameter (const std::string &parameterName) const
 Use in automation process to throw exception when a parameter is missing from the XML scenario file. More...
 

Detailed Description

Container to store data to be used by base objects.

This class is a container to store data used by base objects in the automation process. An object of this class is intended to be created by a XML parser during running PARTONS runtime from a specific XML file, which can be local or can be retrieved from a database. Therefore, this class may be seen as a representation of a set of parameters encoded in a XML file, like:

<kinematics type="GPDKinematic">
<param name="x" value="0.1" />
<param name="xi" value="0.05" />
<param name="t" value="-0.3" />
<param name="MuF2" value="8." />
<param name="MuR2" value="8." />
</kinematics>

Constructor & Destructor Documentation

◆ BaseObjectData() [1/2]

PARTONS::BaseObjectData::BaseObjectData ( )

Default constructor.

◆ BaseObjectData() [2/2]

PARTONS::BaseObjectData::BaseObjectData ( const std::string &  moduleType,
const std::string &  moduleClassName 
)

Assignment constructor.

Parameters
moduleTypeType of module intended to use parameters stored in this class.
moduleClassNameName of module intended to use parameters stored in this class.

◆ ~BaseObjectData()

PARTONS::BaseObjectData::~BaseObjectData ( )
virtual

Destructor.

Member Function Documentation

◆ addParameter()

void PARTONS::BaseObjectData::addParameter ( const ElemUtils::Parameter &  parameter)

Add a single parameter.

Parameters
parameterParameter to be added.

◆ addParameters()

void PARTONS::BaseObjectData::addParameters ( const ElemUtils::Parameters &  parameters)

Add a set of parameters.

Parameters
parametersParameters to be added.

◆ addSubModule()

BaseObjectData & PARTONS::BaseObjectData::addSubModule ( const std::string &  moduleType,
const std::string &  moduleClassName 
)

Add submodule, i.e.

indicate that this BaseObjectData object has a tree-like structure.

Parameters
moduleTypeType of module intended to use parameters stored in this class.
moduleClassNameName of module intended to use parameters stored in this class.
Returns
Reference to added BaseObjectData object.

◆ getLastAvailable()

const BaseObjectData & PARTONS::BaseObjectData::getLastAvailable ( ) const

Get BaseObjectData object indicated by the last call of BaseObjectData::isAvailableSubModule() function.

Returns
Reference to object marked by the last call of BaseObjectData::isAvailableSubModule() function.

◆ getModuleClassName()

const std::string & PARTONS::BaseObjectData::getModuleClassName ( ) const

Get name of module intended to use parameters stored in this class.

◆ getModuleType()

const std::string & PARTONS::BaseObjectData::getModuleType ( ) const

Get type of module intended to use parameters stored in this class.

◆ getParameters()

const ElemUtils::Parameters & PARTONS::BaseObjectData::getParameters ( ) const

Get parameters stored in this class.

◆ getSubModules()

const std::map< std::string, BaseObjectData > & PARTONS::BaseObjectData::getSubModules ( ) const

Get map to build a tree-like structure of BaseObjectData objects to be used if submodules are used.

The keys in the map indicate type of modules intended to use parameters stored in corresponding BaseObjectData objects.

◆ isAvailableSubModule()

bool PARTONS::BaseObjectData::isAvailableSubModule ( const std::string &  moduleClassType) const

Check if parameters of submodule of a given type are available.

Parameters
moduleClassTypeRequested type of submodule.
Returns
True if parameters are available, otherwise false.

◆ setModuleClassName()

void PARTONS::BaseObjectData::setModuleClassName ( const std::string &  moduleClassName)

Set name of module intended to use parameters stored in this class.

◆ setModuleType()

void PARTONS::BaseObjectData::setModuleType ( const std::string &  moduleType)

Set type of module intended to use parameters stored in this class.

◆ setParameters()

void PARTONS::BaseObjectData::setParameters ( const ElemUtils::Parameters &  parameters)

Set parameters stored in this class.

◆ toString()

std::string PARTONS::BaseObjectData::toString ( ) const
virtual

Return a pre-formatted characters string for output visualization of class member's values.

Returns
a pre-formatted characters string.

Reimplemented from PARTONS::BaseObject.

Member Data Documentation

◆ m_it

std::map<std::string, BaseObjectData>::const_iterator PARTONS::BaseObjectData::m_it
mutableprivate

Iterator of BaseObjectData::m_subModules map.

◆ m_moduleClassName

std::string PARTONS::BaseObjectData::m_moduleClassName
private

Name of module intended to use parameters stored in this class.

◆ m_moduleType

std::string PARTONS::BaseObjectData::m_moduleType
private

Type of module intended to use parameters stored in this class.

◆ m_parameters

ElemUtils::Parameters PARTONS::BaseObjectData::m_parameters
private

Parameters stored in this class.

◆ m_subModules

std::map<std::string, BaseObjectData> PARTONS::BaseObjectData::m_subModules
private

Map to build a tree-like structure of BaseObjectData objects to be used if submodules are used.

The keys in the map indicate type of modules intended to use parameters stored in corresponding BaseObjectData objects.


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