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

Class representing single scenario. More...

Inheritance diagram for PARTONS::Scenario:
PARTONS::DatabaseFileObject PARTONS::BaseObject

Public Member Functions

 Scenario ()
 Default constructor. More...
 
 Scenario (const Scenario &other)
 Copy constructor. More...
 
 Scenario (const int indexId, const std::string &description, const time_t storeDate, const std::string &filePath, const std::string &hashSum, const std::string &file)
 Assignment constructor. More...
 
virtual ~Scenario ()
 Destructor. More...
 
const TaskgetTask (unsigned int i) const
 Get reference to task of a given id. More...
 
TaskgetTask (unsigned int i)
 Get reference to task of a given id. More...
 
void add (const Task &task)
 Add a given task to this scenario. More...
 
size_t size () const
 Return number of tasks in this scenario. More...
 
virtual std::string toString () const
 Return a pre-formatted characters string for output visualization of class member's values. More...
 
const std::string & getDescription () const
 Get description of this scenario. More...
 
void setDescription (const std::string &description)
 Set description of this scenario. More...
 
const std::vector< Task > & getTasks () const
 Get vector containing tasks associated to this scenario. More...
 
void setTasks (const std::vector< Task > &tasks)
 Set vector containing tasks associated to this scenario. More...
 
- Public Member Functions inherited from PARTONS::DatabaseFileObject
 DatabaseFileObject (const std::string &className)
 Constructor. More...
 
 DatabaseFileObject (const std::string &className, const int indexId, const time_t storeDate, const std::string &filePath, const std::string &hashSum, const std::string &file)
 Constructor. More...
 
 DatabaseFileObject (const DatabaseFileObject &other)
 Copy constructor. More...
 
virtual ~DatabaseFileObject ()
 Destructor. More...
 
const std::string & getFile () const
 Get reference to DatabaseFileObject::m_file. More...
 
void setFile (const std::string &file)
 Set DatabaseFileObject::m_file. More...
 
const std::string & getHashSum () const
 Get reference to DatabaseFileObject::m_hashSum. More...
 
void setHashSum (const std::string &hashSum)
 Set DatabaseFileObject::m_hashSum. More...
 
time_t getStoreDate () const
 Get DatabaseFileObject::m_storeDate. More...
 
void setStoreDate (time_t storeDate)
 Set DatabaseFileObject::m_storeDate. More...
 
const std::string & getFilePath () const
 Get reference to DatabaseFileObject::m_filePath. More...
 
void setFilePath (const std::string &filePath)
 Set DatabaseFileObject::m_filePath. 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)
 

Protected Member Functions

virtual std::string fillFile () const
 Fill file from database. More...
 
- 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...
 

Private Attributes

std::string m_description
 Description of this scenario. More...
 
std::vector< Taskm_tasks
 Vector containing tasks associated to this scenario. More...
 

Detailed Description

Class representing single scenario.

This class represents a single scenario, i.e. a set of tasks to be evaluated by services. An object of this class is intended to be created by a xml parser during running PARTONS with 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 single scenario encoded in a xml file, like:

<scenario date="2016-03-25" description="Descriptions allow you to distinguish between many scenarios.">
<task service="GPDService" method="computeGPDModel" storeInDB="0">
<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>
<computation_configuration>
<module type="GPDModule">
<param name="className" value="GK11Model" />
</module>
</computation_configuration>
</task>
</scenario>

Constructor & Destructor Documentation

◆ Scenario() [1/3]

PARTONS::Scenario::Scenario ( )

Default constructor.

◆ Scenario() [2/3]

PARTONS::Scenario::Scenario ( const Scenario other)

Copy constructor.

Parameters
otherObject to be copied.

◆ Scenario() [3/3]

PARTONS::Scenario::Scenario ( const int  indexId,
const std::string &  description,
const time_t  storeDate,
const std::string &  filePath,
const std::string &  hashSum,
const std::string &  file 
)

Assignment constructor.

Parameters
indexIdUnique id used when object is created from the database, see BaseObject::m_indexId.
descriptionDescription of this scenario.
storeDateTime of insertion into the database.
filePathPath to file.
hashSumHash sum of file content.
fileString containing file content.

◆ ~Scenario()

PARTONS::Scenario::~Scenario ( )
virtual

Destructor.

Member Function Documentation

◆ add()

void PARTONS::Scenario::add ( const Task task)

Add a given task to this scenario.

Parameters
taskTask to be added.

◆ fillFile()

std::string PARTONS::Scenario::fillFile ( ) const
protectedvirtual

Fill file from database.

Returns
String containing file.

Implements PARTONS::DatabaseFileObject.

◆ getDescription()

const std::string & PARTONS::Scenario::getDescription ( ) const

Get description of this scenario.

◆ getTask() [1/2]

const Task & PARTONS::Scenario::getTask ( unsigned int  i) const

Get reference to task of a given id.

Parameters
iId of task to be retrieved.
Returns
Requested task.

◆ getTask() [2/2]

Task & PARTONS::Scenario::getTask ( unsigned int  i)

Get reference to task of a given id.

Parameters
iId of task to be retrieved.
Returns
Requested task.

◆ getTasks()

const std::vector< Task > & PARTONS::Scenario::getTasks ( ) const

Get vector containing tasks associated to this scenario.

◆ setDescription()

void PARTONS::Scenario::setDescription ( const std::string &  description)

Set description of this scenario.

◆ setTasks()

void PARTONS::Scenario::setTasks ( const std::vector< Task > &  tasks)

Set vector containing tasks associated to this scenario.

◆ size()

size_t PARTONS::Scenario::size ( ) const

Return number of tasks in this scenario.

◆ toString()

std::string PARTONS::Scenario::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::DatabaseFileObject.

Member Data Documentation

◆ m_description

std::string PARTONS::Scenario::m_description
private

Description of this scenario.

◆ m_tasks

std::vector<Task> PARTONS::Scenario::m_tasks
private

Vector containing tasks associated to this scenario.


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