PARTONS  
PARtonic Tomography Of Nucleon Software
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
PARTONS::ServiceObjectTyped< KinematicType, ResultType > Class Template Reference

Abstract class for a service. More...

Inheritance diagram for PARTONS::ServiceObjectTyped< KinematicType, ResultType >:
PARTONS::ServiceObject PARTONS::BaseObject 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

virtual ~ServiceObjectTyped ()
 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...
 
void add (const ResultType &result)
 Add single result to result list. More...
 
void add (const List< ResultType > &resultList)
 Add many results to result list. More...
 
void sortResultList ()
 Sort result list. More...
 
List< ResultType > & getResultList ()
 Get result list. More...
 
void clearResultListBuffer ()
 Clear result list. More...
 
void clearKinematicListBuffer ()
 Clear kinematic list. More...
 
List< ResultType > computeScenario (Scenario &scenario)
 Compute scenario. More...
 
List< ResultType > flushResultList ()
 Flush result list. More...
 
virtual void computeTask (Task &task)
 Compute task. More...
 
- Public Member Functions inherited from PARTONS::ServiceObject
 ServiceObject (const std::string &className)
 Default constructor. More...
 
virtual ~ServiceObject ()
 Default destructor. 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)
 

Static Public Attributes

static const std::string SERVICE_OBJECT_PRINT_RESULTS
 Name of the XML task used to print results via Logger. More...
 

Protected Member Functions

 ServiceObjectTyped (const std::string &className)
 Default constructor. More...
 
bool computeGeneralTask (Task &task)
 General tasks. More...
 
void printResultListBuffer ()
 Print results to buffer. More...
 
void updateResultInfo (ResultType &result, const ResultInfo &resultInfo)
 Update result info. More...
 
void updateResultInfo (List< ResultType > &resultList, const ResultInfo &resultInfo)
 Update result info. More...
 
- Protected Member Functions inherited from PARTONS::ServiceObject
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

unsigned int m_batchSize
 Batch size. More...
 
sf::Mutex m_mutexKinematicList
 Mutex for kinematic list. More...
 
sf::Mutex m_mutexResultListBuffer
 Mutex for result list. More...
 
List< KinematicTypem_kinematicListBuffer
 Kinematic list. More...
 
List< ResultType > m_resultListBuffer
 Result list. More...
 
ResultInfo m_resultInfo
 Result info. More...
 
- Protected Attributes inherited from PARTONS::ServiceObject
ModuleObjectFactorym_pModuleObjectFactory
 Pointer to ModuleObjectFactory. More...
 
AutomationServicem_pAutomationService
 Pointer to AutomationService. More...
 

Detailed Description

template<typename KinematicType, typename ResultType>
class PARTONS::ServiceObjectTyped< KinematicType, ResultType >

Abstract class for a service.

Constructor & Destructor Documentation

◆ ~ServiceObjectTyped()

template<typename KinematicType , typename ResultType >
virtual PARTONS::ServiceObjectTyped< KinematicType, ResultType >::~ServiceObjectTyped ( )
inlinevirtual

Destructor.

◆ ServiceObjectTyped()

template<typename KinematicType , typename ResultType >
PARTONS::ServiceObjectTyped< KinematicType, ResultType >::ServiceObjectTyped ( const std::string &  className)
inlineprotected

Default constructor.

Member Function Documentation

◆ add() [1/2]

template<typename KinematicType , typename ResultType >
void PARTONS::ServiceObjectTyped< KinematicType, ResultType >::add ( const List< ResultType > &  resultList)
inline

Add many results to result list.

◆ add() [2/2]

template<typename KinematicType , typename ResultType >
void PARTONS::ServiceObjectTyped< KinematicType, ResultType >::add ( const ResultType &  result)
inline

Add single result to result list.

◆ clearKinematicListBuffer()

template<typename KinematicType , typename ResultType >
void PARTONS::ServiceObjectTyped< KinematicType, ResultType >::clearKinematicListBuffer ( )
inline

Clear kinematic list.

◆ clearResultListBuffer()

template<typename KinematicType , typename ResultType >
void PARTONS::ServiceObjectTyped< KinematicType, ResultType >::clearResultListBuffer ( )
inline

Clear result list.

◆ computeGeneralTask()

template<typename KinematicType , typename ResultType >
bool PARTONS::ServiceObjectTyped< KinematicType, ResultType >::computeGeneralTask ( Task task)
inlineprotected

General tasks.

◆ computeScenario()

template<typename KinematicType , typename ResultType >
List<ResultType> PARTONS::ServiceObjectTyped< KinematicType, ResultType >::computeScenario ( Scenario scenario)
inline

Compute scenario.

◆ computeTask()

template<typename KinematicType , typename ResultType >
virtual void PARTONS::ServiceObjectTyped< KinematicType, ResultType >::computeTask ( Task task)
inlinevirtual

◆ flushResultList()

template<typename KinematicType , typename ResultType >
List<ResultType> PARTONS::ServiceObjectTyped< KinematicType, ResultType >::flushResultList ( )
inline

Flush result list.

◆ getResultList()

template<typename KinematicType , typename ResultType >
List<ResultType>& PARTONS::ServiceObjectTyped< KinematicType, ResultType >::getResultList ( )
inline

Get result list.

◆ printResultListBuffer()

template<typename KinematicType , typename ResultType >
void PARTONS::ServiceObjectTyped< KinematicType, ResultType >::printResultListBuffer ( )
inlineprotected

Print results to buffer.

◆ resolveObjectDependencies()

template<typename KinematicType , typename ResultType >
virtual void PARTONS::ServiceObjectTyped< KinematicType, ResultType >::resolveObjectDependencies ( )
inlinevirtual

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::ServiceObject.

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 >, and PARTONS::CollinearDistributionService.

◆ sortResultList()

template<typename KinematicType , typename ResultType >
void PARTONS::ServiceObjectTyped< KinematicType, ResultType >::sortResultList ( )
inline

Sort result list.

◆ updateResultInfo() [1/2]

template<typename KinematicType , typename ResultType >
void PARTONS::ServiceObjectTyped< KinematicType, ResultType >::updateResultInfo ( List< ResultType > &  resultList,
const ResultInfo resultInfo 
)
inlineprotected

Update result info.

◆ updateResultInfo() [2/2]

template<typename KinematicType , typename ResultType >
void PARTONS::ServiceObjectTyped< KinematicType, ResultType >::updateResultInfo ( ResultType &  result,
const ResultInfo resultInfo 
)
inlineprotected

Update result info.

Member Data Documentation

◆ m_batchSize

template<typename KinematicType , typename ResultType >
unsigned int PARTONS::ServiceObjectTyped< KinematicType, ResultType >::m_batchSize
protected

Batch size.

◆ m_kinematicListBuffer

template<typename KinematicType , typename ResultType >
List<KinematicType> PARTONS::ServiceObjectTyped< KinematicType, ResultType >::m_kinematicListBuffer
protected

Kinematic list.

◆ m_mutexKinematicList

template<typename KinematicType , typename ResultType >
sf::Mutex PARTONS::ServiceObjectTyped< KinematicType, ResultType >::m_mutexKinematicList
protected

Mutex for kinematic list.

◆ m_mutexResultListBuffer

template<typename KinematicType , typename ResultType >
sf::Mutex PARTONS::ServiceObjectTyped< KinematicType, ResultType >::m_mutexResultListBuffer
protected

Mutex for result list.

◆ m_resultInfo

template<typename KinematicType , typename ResultType >
ResultInfo PARTONS::ServiceObjectTyped< KinematicType, ResultType >::m_resultInfo
protected

Result info.

◆ m_resultListBuffer

template<typename KinematicType , typename ResultType >
List<ResultType> PARTONS::ServiceObjectTyped< KinematicType, ResultType >::m_resultListBuffer
protected

Result list.

◆ SERVICE_OBJECT_PRINT_RESULTS

template<typename KinematicType , typename ResultType >
const std::string PARTONS::ServiceObjectTyped< KinematicType, ResultType >::SERVICE_OBJECT_PRINT_RESULTS
static
Initial value:
=
"printResults"

Name of the XML task used to print results via Logger.


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