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

Automation service is designed to dynamically run complex tasks (by calling service object methods) or to create some complex C++ objects, all described by an XML file. More...

Inheritance diagram for PARTONS::AutomationService:
PARTONS::BaseObject

Public Member Functions

 AutomationService (const std::string &className)
 Constructor. More...
 
virtual ~AutomationService ()
 Default destructor. More...
 
virtual void resolveObjectDependencies ()
 Call resolveObjectDependencies method of XMLValidatorI interface (after all modules have been registered and after all programm have been started) to retrieve XML schema file path from property file. More...
 
ScenarioparseXMLFile (const std::string &xmlFilePath) const
 Open and validate XML file with XML schema file. More...
 
void playScenario (Scenario *pScenario) const
 
ScenarioparseScenario (Scenario *pScenario) const
 
- 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 unsigned int classId
 Unique ID to automatically register the class in the registry. More...
 

Private Member Functions

const std::string & getXmlSchemaFile () const
 

Private Attributes

std::string m_xmlSchemaFile
 
XMLValidatorIm_pXMLValidatorI
 Specific interface to allow the plug or unplug xml validator (see AutomationService constructor) for third party libraries. Helpful for developers to avoid code rewriting and for more flexibility. More...
 
XMLParserIm_pXMLParserI
 Specific interface to allow the plug or unplug xml parser (see AutomationService constructor) for third party libraries. Helpful for developers to avoid code rewriting and for more flexibility. More...
 
CryptographicHashServicem_pCryptographicHashService
 
ResourceManagerm_pResourceManager
 

Static Private Attributes

static const std::string PROPERTY_NAME_XML_SCHEMA_FILE_PATH
 

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

Automation service is designed to dynamically run complex tasks (by calling service object methods) or to create some complex C++ objects, all described by an XML file.

It allow users to perform complex tasks in a simple way without know C++ programming language and without rebuild their project. Automation service provides some methods to retrieve Scenario or ComputationConfiguration objects from a specific XML file. Scenario can be used to automates the whole computation process by calling many other services to performs tasks previously defined in XML file. ComputationConfiguration is only used to configure a specific module, then you can do whatever you want with this new pre-configured module.

Constructor & Destructor Documentation

◆ AutomationService()

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

Constructor.

Parameters
className

◆ ~AutomationService()

PARTONS::AutomationService::~AutomationService ( )
virtual

Default destructor.

Member Function Documentation

◆ getXmlSchemaFile()

const std::string & PARTONS::AutomationService::getXmlSchemaFile ( ) const
private

◆ parseScenario()

Scenario * PARTONS::AutomationService::parseScenario ( Scenario pScenario) const

◆ parseXMLFile()

Scenario * PARTONS::AutomationService::parseXMLFile ( const std::string &  xmlFilePath) const

Open and validate XML file with XML schema file.

Then parse it and return string representation of this file into a Scenario object.

Parameters
xmlFilePath
Returns
string representation of XML file into a Scenario object

◆ playScenario()

void PARTONS::AutomationService::playScenario ( Scenario pScenario) const
Parameters
pScenario

◆ resolveObjectDependencies()

void PARTONS::AutomationService::resolveObjectDependencies ( )
virtual

Call resolveObjectDependencies method of XMLValidatorI interface (after all modules have been registered and after all programm have been started) to retrieve XML schema file path from property file.

Reimplemented from PARTONS::BaseObject.

Member Data Documentation

◆ classId

const unsigned int PARTONS::AutomationService::classId
static
Initial value:

Unique ID to automatically register the class in the registry.

◆ m_pCryptographicHashService

CryptographicHashService* PARTONS::AutomationService::m_pCryptographicHashService
private

◆ m_pResourceManager

ResourceManager* PARTONS::AutomationService::m_pResourceManager
private

◆ m_pXMLParserI

XMLParserI* PARTONS::AutomationService::m_pXMLParserI
private

Specific interface to allow the plug or unplug xml parser (see AutomationService constructor) for third party libraries. Helpful for developers to avoid code rewriting and for more flexibility.

◆ m_pXMLValidatorI

XMLValidatorI* PARTONS::AutomationService::m_pXMLValidatorI
private

Specific interface to allow the plug or unplug xml validator (see AutomationService constructor) for third party libraries. Helpful for developers to avoid code rewriting and for more flexibility.

◆ m_xmlSchemaFile

std::string PARTONS::AutomationService::m_xmlSchemaFile
private

◆ PROPERTY_NAME_XML_SCHEMA_FILE_PATH

const std::string PARTONS::AutomationService::PROPERTY_NAME_XML_SCHEMA_FILE_PATH
staticprivate
Initial value:
=
"xml.schema.file.path"

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