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

Services hide the complexity of low-level functions to provide high-level functionalities to the user. More...

Inheritance diagram for PARTONS::ServiceObject:
PARTONS::BaseObject PARTONS::ServiceObjectTyped< CollinearDistributionKinematic, CollinearDistributionResult > PARTONS::ServiceObjectTyped< GPDKinematic, GPDResult > PARTONS::ComparisonService PARTONS::CryptographicHashService PARTONS::ServiceObjectTyped< KinematicType, ResultType > PARTONS::VizualisationService PARTONS::CollinearDistributionService PARTONS::GPDService PARTONS::ConvolCoeffFunctionService< TCSConvolCoeffFunctionKinematic, TCSConvolCoeffFunctionResult > PARTONS::ConvolCoeffFunctionService< DDVCSConvolCoeffFunctionKinematic, DDVCSConvolCoeffFunctionResult > PARTONS::ConvolCoeffFunctionService< DVCSConvolCoeffFunctionKinematic, DVCSConvolCoeffFunctionResult > PARTONS::ConvolCoeffFunctionService< DVMPConvolCoeffFunctionKinematic, DVMPConvolCoeffFunctionResult > PARTONS::ObservableService< DDVCSObservableKinematic, DDVCSObservableResult > PARTONS::ObservableService< DVCSObservableKinematic, DVCSObservableResult > PARTONS::ObservableService< TCSObservableKinematic, TCSObservableResult > PARTONS::ObservableService< DVMPObservableKinematic, DVMPObservableResult > PARTONS::ConvolCoeffFunctionService< KinematicType, ResultType > PARTONS::ObservableService< KinematicType, ResultType >

Public Member Functions

 ServiceObject (const std::string &className)
 Default constructor. More...
 
virtual ~ServiceObject ()
 Default destructor. 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...
 
virtual void computeTask (Task &task)=0
 Method used in automation to compute given tasks. More...
 
void addTasks (const List< ElemUtils::Packet > &tasks)
 Add task to queue. More...
 
bool isEmptyTaskQueue ()
 Check if queue is empty. More...
 
ElemUtils::Packet popTaskFormQueue ()
 Pop task from queue. More...
 
void initComputationalThread (ModuleObject *pModuleObject)
 Initialize all threads. More...
 
void launchAllThreadAndWaitingFor ()
 Lunch all threads. More...
 
void clearAllThread ()
 Clear all threads. More...
 
std::string generateSQLQueryForPlotFile (const std::string &tableName, const ElemUtils::Parameters &selectParams, const ElemUtils::Parameters &whereParams) const
 Generate SQL query to create a plot file. More...
 
void generatePlotFile (const std::string &filePath, const std::string &sqlQuery, const char splitChar) const
 Generate a plot file. 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 std::string toString () const
 Return a pre-formatted characters string for output visualization of class member's values. 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

std::string generateSQLQueryForPlotFileTask (Task &task, const std::string &tableName) const
 Generate SQL query from a task. More...
 
std::string getOutputFilePathForPlotFileTask (Task &task) const
 Get path to a plot file from a task. More...
 
List< GPDTypegetGPDTypeListFromTask (Task &task) const
 Get list of GPD types to be computed from a task. More...
 
List< CollinearDistributionTypegetCollinearDistributionTypeListFromTask (Task &task) const
 Get list of Collinear Distribution types to be computed from a task. More...
 
void errorUnknownMethod (const Task &task) const
 Throw exception if unknown method. 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...
 

Protected Attributes

ModuleObjectFactorym_pModuleObjectFactory
 Pointer to ModuleObjectFactory. More...
 
AutomationServicem_pAutomationService
 Pointer to AutomationService. More...
 

Private Attributes

ThreadQueue m_queueOfTask
 Queue of tasks. More...
 
ThreadManager m_threadManager
 Thread manager. More...
 

Detailed Description

Services hide the complexity of low-level functions to provide high-level functionalities to the user.

A service is basically a toolbox for the user: the user is being given tools to use the software without knowing the details of its operating. Services combine different modules and datasets to produce results in a transparent way.

For example : the GPDService provide several functions that hide the complexity related to repetitive tasks, like evaluating a GPD at a list of kinematic configurations, or evaluating several GPD models at the same input kinematic.

Constructor & Destructor Documentation

◆ ServiceObject()

PARTONS::ServiceObject::ServiceObject ( const std::string &  className)

Default constructor.

Parameters
className

◆ ~ServiceObject()

PARTONS::ServiceObject::~ServiceObject ( )
virtual

Default destructor.

Member Function Documentation

◆ addTasks()

void PARTONS::ServiceObject::addTasks ( const List< ElemUtils::Packet > &  tasks)

Add task to queue.

◆ clearAllThread()

void PARTONS::ServiceObject::clearAllThread ( )

Clear all threads.

◆ computeTask()

virtual void PARTONS::ServiceObject::computeTask ( Task task)
pure virtual

◆ errorUnknownMethod()

void PARTONS::ServiceObject::errorUnknownMethod ( const Task task) const
protected

Throw exception if unknown method.

◆ generatePlotFile()

void PARTONS::ServiceObject::generatePlotFile ( const std::string &  filePath,
const std::string &  sqlQuery,
const char  splitChar 
) const

Generate a plot file.

◆ generateSQLQueryForPlotFile()

std::string PARTONS::ServiceObject::generateSQLQueryForPlotFile ( const std::string &  tableName,
const ElemUtils::Parameters &  selectParams,
const ElemUtils::Parameters &  whereParams 
) const

Generate SQL query to create a plot file.

◆ generateSQLQueryForPlotFileTask()

std::string PARTONS::ServiceObject::generateSQLQueryForPlotFileTask ( Task task,
const std::string &  tableName 
) const
protected

Generate SQL query from a task.

◆ getCollinearDistributionTypeListFromTask()

List< CollinearDistributionType > PARTONS::ServiceObject::getCollinearDistributionTypeListFromTask ( Task task) const
protected

Get list of Collinear Distribution types to be computed from a task.

◆ getGPDTypeListFromTask()

List< GPDType > PARTONS::ServiceObject::getGPDTypeListFromTask ( Task task) const
protected

Get list of GPD types to be computed from a task.

◆ getOutputFilePathForPlotFileTask()

std::string PARTONS::ServiceObject::getOutputFilePathForPlotFileTask ( Task task) const
protected

Get path to a plot file from a task.

◆ initComputationalThread()

void PARTONS::ServiceObject::initComputationalThread ( ModuleObject pModuleObject)

Initialize all threads.

◆ isEmptyTaskQueue()

bool PARTONS::ServiceObject::isEmptyTaskQueue ( )

Check if queue is empty.

◆ launchAllThreadAndWaitingFor()

void PARTONS::ServiceObject::launchAllThreadAndWaitingFor ( )

Lunch all threads.

◆ popTaskFormQueue()

ElemUtils::Packet PARTONS::ServiceObject::popTaskFormQueue ( )

Pop task from queue.

◆ resolveObjectDependencies()

void PARTONS::ServiceObject::resolveObjectDependencies ( )
virtual

Because of the initialization step order of the program, objects are registered in a total random order and some objects depend on others.

To avoid the problem of pointer resolution order, this method is called by the BaseObjectRegistery after all objects are well registered in it. See BaseObjectRegistry class documentation for more details.

Reimplemented from PARTONS::BaseObject.

Reimplemented in PARTONS::TCSObservableService, PARTONS::TCSConvolCoeffFunctionService, PARTONS::ObservableService< KinematicType, ResultType >, PARTONS::ObservableService< DDVCSObservableKinematic, DDVCSObservableResult >, PARTONS::ObservableService< DVCSObservableKinematic, DVCSObservableResult >, PARTONS::ObservableService< TCSObservableKinematic, TCSObservableResult >, PARTONS::ObservableService< DVMPObservableKinematic, DVMPObservableResult >, PARTONS::GPDService, PARTONS::DVMPObservableService, PARTONS::DVMPConvolCoeffFunctionService, PARTONS::DVCSObservableService, PARTONS::DVCSConvolCoeffFunctionService, PARTONS::DDVCSObservableService, PARTONS::DDVCSConvolCoeffFunctionService, PARTONS::ConvolCoeffFunctionService< KinematicType, ResultType >, PARTONS::ConvolCoeffFunctionService< TCSConvolCoeffFunctionKinematic, TCSConvolCoeffFunctionResult >, PARTONS::ConvolCoeffFunctionService< DDVCSConvolCoeffFunctionKinematic, DDVCSConvolCoeffFunctionResult >, PARTONS::ConvolCoeffFunctionService< DVCSConvolCoeffFunctionKinematic, DVCSConvolCoeffFunctionResult >, PARTONS::ConvolCoeffFunctionService< DVMPConvolCoeffFunctionKinematic, DVMPConvolCoeffFunctionResult >, PARTONS::CollinearDistributionService, PARTONS::ServiceObjectTyped< KinematicType, ResultType >, PARTONS::ServiceObjectTyped< CollinearDistributionKinematic, CollinearDistributionResult >, and PARTONS::ServiceObjectTyped< GPDKinematic, GPDResult >.

Member Data Documentation

◆ m_pAutomationService

AutomationService* PARTONS::ServiceObject::m_pAutomationService
protected

Pointer to AutomationService.

◆ m_pModuleObjectFactory

ModuleObjectFactory* PARTONS::ServiceObject::m_pModuleObjectFactory
protected

Pointer to ModuleObjectFactory.

◆ m_queueOfTask

ThreadQueue PARTONS::ServiceObject::m_queueOfTask
private

Queue of tasks.

◆ m_threadManager

ThreadManager PARTONS::ServiceObject::m_threadManager
private

Thread manager.


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