#include <MinimalEventLoopMgr.h>
Inheritance diagram for MinimalEventLoopMgr:
Public Types | |
typedef std::list< IAlgorithm * > | ListAlg |
Creator friend class. | |
typedef std::list< std::string > | ListName |
typedef std::vector< std::string > | VectorName |
SUCCESS = 1 | |
Normal successful completion. | |
NO_INTERFACE | |
Requested interface is not available. | |
VERSMISMATCH | |
Requested interface version is incompatible. | |
LAST_ERROR | |
Last error. | |
enum | Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR } |
Return status. More... | |
Public Member Functions | |
MinimalEventLoopMgr (const std::string &nam, ISvcLocator *svcLoc) | |
Standard Constructor. | |
virtual | ~MinimalEventLoopMgr () |
Standard Destructor. | |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface) |
implementation of IInterface: queryInterface | |
virtual StatusCode | initialize () |
implementation of IService::initalize | |
virtual StatusCode | start () |
implementation of IService::start | |
virtual StatusCode | stop () |
implementation of IService::stop | |
virtual StatusCode | finalize () |
implementation of IService::finalize | |
virtual StatusCode | reinitialize () |
implementation of IService::reinitialize | |
virtual StatusCode | restart () |
implementation of IService::restart | |
virtual StatusCode | nextEvent (int maxevt) |
implementation of IEventProcessor::nextEvent | |
virtual StatusCode | executeEvent (void *par) |
implementation of IEventProcessor::executeEvent(void* par) | |
virtual StatusCode | executeRun (int maxevt) |
implementation of IEventProcessor::executeRun( ) | |
virtual StatusCode | stopRun () |
implementation of IEventProcessor::stopRun( ) | |
void | topAlgHandler (Property &p) |
Top algorithm List handler. | |
StatusCode | decodeTopAlgs () |
decodeTopAlgNameList & topAlgNameListHandler | |
void | outStreamHandler (Property &p) |
Output stream List handler. | |
StatusCode | decodeOutStreams () |
decodeOutStreamNameList & outStreamNameListHandler | |
virtual unsigned long | addRef () |
Reference Interface instance. | |
virtual unsigned long | release () |
Release Interface instance. | |
virtual const std::string & | name () const |
Retrieve name of the service. | |
virtual const InterfaceID & | type () const |
Retrieve ID of the Service. | |
virtual StatusCode | configure () |
Configuration (from OFFLINE to CONFIGURED). | |
virtual StatusCode | terminate () |
Initialization (from CONFIGURED to OFFLINE). | |
virtual Gaudi::StateMachine::State | FSMState () const |
Get the current state. | |
virtual Gaudi::StateMachine::State | targetFSMState () const |
When we are in the middle of a transition, get the state where the transition is leading us. | |
virtual StatusCode | sysInitialize () |
Initilize Service. | |
virtual StatusCode | sysStart () |
Initilize Service. | |
virtual StatusCode | sysStop () |
Initilize Service. | |
virtual StatusCode | sysFinalize () |
Finalize Service. | |
virtual StatusCode | sysReinitialize () |
Re-initialize the Service. | |
virtual StatusCode | sysRestart () |
Re-initialize the Service. | |
virtual StatusCode | setProperty (const Property &p) |
Set the property by property. | |
virtual StatusCode | setProperty (const std::string &s) |
Set the property by string. | |
virtual StatusCode | setProperty (const std::string &n, const std::string &v) |
Set the property by std::string. | |
template<class TYPE> | |
StatusCode | setProperty (const std::string &name, const TYPE &value) |
set the property form the value | |
virtual StatusCode | getProperty (Property *p) const |
Get the property by property. | |
virtual const Property & | getProperty (const std::string &name) const |
Get the property by name. | |
virtual StatusCode | getProperty (const std::string &n, std::string &v) const |
Get the property by std::string. | |
virtual const std::vector< Property * > & | getProperties () const |
Get list of properties. | |
ISvcLocator * | serviceLocator () const |
Retrieve pointer to service locator. | |
IMessageSvc * | msgSvc () |
Retrieve pointer to message service. | |
IMessageSvc * | msgSvc () const |
IMessageSvc * | messageService () |
IMessageSvc * | messageService () const |
StatusCode | setProperties () |
Method for setting declared properties to the values specifed for the job. | |
template<class T> | |
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const |
Access a service by name, creating it if it doesn't already exist. | |
template<class T> | |
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const |
Access a service by name and type, creating it if it doesn't already exist. | |
template<class T> | |
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
Declare the named property. | |
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const |
Declare remote named properties. | |
IAuditorSvc * | auditorSvc () const |
The standard auditor service.May not be invoked before sysInitialize() has been invoked. | |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
Retrieve interface ID. | |
static const InterfaceID & | interfaceID () |
Retrieve interface ID. | |
static const InterfaceID & | interfaceID () |
Retrieve interface ID. | |
static const InterfaceID & | interfaceID () |
Retrieve interface ID. | |
Protected Types | |
OFFLINE | |
CONFIGURED | |
FINALIZED | |
INITIALIZED | |
enum | State { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED } |
Protected Member Functions | |
template<class T> | |
T * | releaseInterface (T *iface) |
Helper to release interface pointer. | |
int | outputLevel () const |
get the Service's output level | |
Protected Attributes | |
IAppMgrUI * | m_appMgrUI |
Reference to the IAppMgrUI interface of the application manager. | |
IIncidentSvc * | m_incidentSvc |
Reference to the indicent service. | |
ListAlg | m_topAlgList |
List of top level algorithms. | |
ListAlg | m_outStreamList |
List of output streams. | |
std::string | m_outStreamType |
Out Stream type. | |
StringArrayProperty | m_topAlgNames |
List of top level algorithms names. | |
StringArrayProperty | m_outStreamNames |
List of output stream names. | |
State | m_state |
State of the object. | |
bool | m_scheduledStop |
Scheduled stop of event processing. | |
IIncidentListener * | m_abortEventListener |
Instance of the incident listener waiting for AbortEvent. | |
bool | m_abortEvent |
Flag signalling that the event being processedhas to be aborted (skip all following top algs). | |
std::string | m_abortEventSource |
Source of the AbortEvent incident. | |
IntegerProperty | m_outputLevel |
Service output level. | |
Gaudi::StateMachine::State | m_targetState |
Service state. | |
IMessageSvc * | m_messageSvc |
MessageSvc reference. | |
Friends | |
class | ServiceManager |
This object handles the minimal requirements needed by the application manager. It also is capable of handling a bunch of algorithms and output streams. However, they list may as well be empty.
Definition at line 28 of file MinimalEventLoopMgr.h.
typedef std::list<IAlgorithm*> MinimalEventLoopMgr::ListAlg |
typedef std::list<std::string> MinimalEventLoopMgr::ListName |
Definition at line 34 of file MinimalEventLoopMgr.h.
typedef std::vector<std::string> MinimalEventLoopMgr::VectorName |
Definition at line 35 of file MinimalEventLoopMgr.h.
enum MinimalEventLoopMgr::State [protected] |
Definition at line 39 of file MinimalEventLoopMgr.h.
00039 { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED };
enum IInterface::Status [inherited] |
Return status.
SUCCESS | Normal successful completion. |
NO_INTERFACE | Requested interface is not available. |
VERSMISMATCH | Requested interface version is incompatible. |
LAST_ERROR | Last error. |
Reimplemented in IConversionSvc, IConverter, and IDataProviderSvc.
Definition at line 113 of file IInterface.h.
00113 { 00115 SUCCESS = 1, 00117 NO_INTERFACE, 00119 VERSMISMATCH, 00121 LAST_ERROR 00122 };
MinimalEventLoopMgr::MinimalEventLoopMgr | ( | const std::string & | nam, | |
ISvcLocator * | svcLoc | |||
) |
Standard Constructor.
virtual MinimalEventLoopMgr::~MinimalEventLoopMgr | ( | ) | [virtual] |
Standard Destructor.
T* MinimalEventLoopMgr::releaseInterface | ( | T * | iface | ) | [inline, protected] |
virtual StatusCode MinimalEventLoopMgr::queryInterface | ( | const InterfaceID & | riid, | |
void ** | ppvInterface | |||
) | [virtual] |
virtual StatusCode MinimalEventLoopMgr::initialize | ( | ) | [virtual] |
virtual StatusCode MinimalEventLoopMgr::start | ( | ) | [virtual] |
virtual StatusCode MinimalEventLoopMgr::stop | ( | ) | [virtual] |
virtual StatusCode MinimalEventLoopMgr::finalize | ( | ) | [virtual] |
virtual StatusCode MinimalEventLoopMgr::reinitialize | ( | ) | [virtual] |
virtual StatusCode MinimalEventLoopMgr::restart | ( | ) | [virtual] |
virtual StatusCode MinimalEventLoopMgr::nextEvent | ( | int | maxevt | ) | [virtual] |
virtual StatusCode MinimalEventLoopMgr::executeEvent | ( | void * | par | ) | [virtual] |
virtual StatusCode MinimalEventLoopMgr::executeRun | ( | int | maxevt | ) | [virtual] |
virtual StatusCode MinimalEventLoopMgr::stopRun | ( | ) | [virtual] |
void MinimalEventLoopMgr::topAlgHandler | ( | Property & | p | ) |
Top algorithm List handler.
StatusCode MinimalEventLoopMgr::decodeTopAlgs | ( | ) |
decodeTopAlgNameList & topAlgNameListHandler
void MinimalEventLoopMgr::outStreamHandler | ( | Property & | p | ) |
Output stream List handler.
StatusCode MinimalEventLoopMgr::decodeOutStreams | ( | ) |
decodeOutStreamNameList & outStreamNameListHandler
virtual unsigned long Service::addRef | ( | ) | [virtual, inherited] |
virtual unsigned long Service::release | ( | ) | [virtual, inherited] |
virtual const std::string& Service::name | ( | ) | const [virtual, inherited] |
virtual const InterfaceID& Service::type | ( | ) | const [virtual, inherited] |
virtual StatusCode Service::configure | ( | ) | [inline, virtual, inherited] |
Configuration (from OFFLINE to CONFIGURED).
Implements IService.
Definition at line 53 of file Service.h.
00053 { return StatusCode::SUCCESS; }
virtual StatusCode Service::terminate | ( | ) | [inline, virtual, inherited] |
Initialization (from CONFIGURED to OFFLINE).
Implements IService.
Definition at line 58 of file Service.h.
00058 { return StatusCode::SUCCESS; }
virtual Gaudi::StateMachine::State Service::FSMState | ( | ) | const [inline, virtual, inherited] |
virtual Gaudi::StateMachine::State Service::targetFSMState | ( | ) | const [inline, virtual, inherited] |
When we are in the middle of a transition, get the state where the transition is leading us.
Otherwise it returns the same state as state().
Implements IService.
Definition at line 60 of file Service.h.
00060 { return m_targetState; }
virtual StatusCode Service::sysInitialize | ( | ) | [virtual, inherited] |
virtual StatusCode Service::sysStart | ( | ) | [virtual, inherited] |
virtual StatusCode Service::sysStop | ( | ) | [virtual, inherited] |
virtual StatusCode Service::sysFinalize | ( | ) | [virtual, inherited] |
virtual StatusCode Service::sysReinitialize | ( | ) | [virtual, inherited] |
virtual StatusCode Service::sysRestart | ( | ) | [virtual, inherited] |
virtual StatusCode Service::setProperty | ( | const Property & | p | ) | [virtual, inherited] |
virtual StatusCode Service::setProperty | ( | const std::string & | s | ) | [virtual, inherited] |
virtual StatusCode Service::setProperty | ( | const std::string & | n, | |
const std::string & | v | |||
) | [virtual, inherited] |
StatusCode Service::setProperty | ( | const std::string & | name, | |
const TYPE & | value | |||
) | [inline, inherited] |
set the property form the value
std::vector<double> data = ... ; setProperty( "Data" , data ) ; std::map<std::string,double> cuts = ... ; setProperty( "Cuts" , cuts ) ; std::map<std::string,std::string> dict = ... ; setProperty( "Dictionary" , dict ) ;
Note: the interface IProperty allows setting of the properties either directly from other properties or from strings only
This is very convinient in resetting of the default properties in the derived classes. E.g. without this method one needs to convert everything into strings to use IProperty::setProperty
setProperty ( "OutputLevel" , "1" ) ; setProperty ( "Enable" , "True" ) ; setProperty ( "ErrorMax" , "10" ) ;
For simple cases it is more or less ok, but for complicated properties it is just ugly..
name | name of the property | |
value | value of the property |
Definition at line 128 of file Service.h.
00130 { return Gaudi::Utils::setProperty ( m_propertyMgr , name , value ) ; }
virtual StatusCode Service::getProperty | ( | Property * | p | ) | const [virtual, inherited] |
virtual const Property& Service::getProperty | ( | const std::string & | name | ) | const [virtual, inherited] |
virtual StatusCode Service::getProperty | ( | const std::string & | n, | |
std::string & | v | |||
) | const [virtual, inherited] |
virtual const std::vector<Property*>& Service::getProperties | ( | ) | const [virtual, inherited] |
ISvcLocator* Service::serviceLocator | ( | ) | const [inherited] |
Retrieve pointer to service locator.
IMessageSvc* Service::msgSvc | ( | ) | [inherited] |
Retrieve pointer to message service.
IMessageSvc* Service::msgSvc | ( | ) | const [inherited] |
IMessageSvc* Service::messageService | ( | ) | [inherited] |
IMessageSvc* Service::messageService | ( | ) | const [inherited] |
StatusCode Service::setProperties | ( | ) | [inherited] |
Method for setting declared properties to the values specifed for the job.
StatusCode Service::service | ( | const std::string & | name, | |
T *& | psvc, | |||
bool | createIf = true | |||
) | const [inline, inherited] |
StatusCode Service::service | ( | const std::string & | svcType, | |
const std::string & | svcName, | |||
T *& | psvc | |||
) | const [inline, inherited] |
Property* Service::declareProperty | ( | const std::string & | name, | |
T & | property, | |||
const std::string & | doc = "none" | |||
) | const [inline, inherited] |
Declare the named property.
MySvc ( const std::string& name , ISvcLocator* pSvc ) : Service ( name , pSvc ) , m_property1 ( ... ) , m_property2 ( ... ) { // declare the property declareProperty( "Property1" , m_property1 , "Doc fro property #1" ) ; // declare the property and attach the handler to it declareProperty( "Property2" , m_property2 , "Doc for property #2" ) -> declareUpdateHandler( &MyAlg::handler_2 ) ; }
name | the property name | |
proeprty | the property itself, | |
doc | the documentation string |
Definition at line 194 of file Service.h.
00197 { 00198 return m_propertyMgr -> declareProperty ( name , property , doc ) ; 00199 }
Property* Service::declareRemoteProperty | ( | const std::string & | name, | |
IProperty * | rsvc, | |||
const std::string & | rname = "" | |||
) | const [inline, inherited] |
Declare remote named properties.
This is used to declare as a local property a property of another services or algorithm. The only needed information is IProperty interface of the remote service and the its property name if different of the current one.
name | Local property name | |
rsvc | Remote IProperty interface | |
rname | Name of the property at remote service |
Definition at line 210 of file Service.h.
00213 { 00214 return m_propertyMgr -> declareRemoteProperty ( name , rsvc , rname ) ; 00215 }
IAuditorSvc* Service::auditorSvc | ( | ) | const [inherited] |
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
int Service::outputLevel | ( | ) | const [inline, protected, inherited] |
get the Service's
output level
Definition at line 235 of file Service.h.
00235 { return m_outputLevel.value(); }
static const InterfaceID& IService::interfaceID | ( | ) | [inline, static, inherited] |
Retrieve interface ID.
Reimplemented from INamedInterface.
Reimplemented in IAuditorSvc, IChronoStatSvc, IHistorySvc, IIssueLogger, IMagneticFieldSvc, IParticlePropertySvc, IPartPropSvc, IRndmGenSvc, IStatusCodeSvc, and ITHistSvc.
Definition at line 26 of file IService.h.
00026 { return IID_IService; }
static const InterfaceID& IProperty::interfaceID | ( | ) | [inline, static, inherited] |
Retrieve interface ID.
Reimplemented from IInterface.
Definition at line 28 of file IProperty.h.
00028 { return IID_IProperty; }
static const InterfaceID& IStateful::interfaceID | ( | ) | [inline, static, inherited] |
Retrieve interface ID.
Reimplemented from IInterface.
Definition at line 23 of file IStateful.h.
00023 { return IID_IStateful; }
static const InterfaceID& IEventProcessor::interfaceID | ( | ) | [inline, static, inherited] |
Retrieve interface ID.
Reimplemented from IInterface.
Definition at line 23 of file IEventProcessor.h.
00023 { return IID_IEventProcessor; }
friend class ServiceManager [friend, inherited] |
IAppMgrUI* MinimalEventLoopMgr::m_appMgrUI [protected] |
Reference to the IAppMgrUI interface of the application manager.
Definition at line 41 of file MinimalEventLoopMgr.h.
IIncidentSvc* MinimalEventLoopMgr::m_incidentSvc [protected] |
ListAlg MinimalEventLoopMgr::m_topAlgList [protected] |
ListAlg MinimalEventLoopMgr::m_outStreamList [protected] |
std::string MinimalEventLoopMgr::m_outStreamType [protected] |
State MinimalEventLoopMgr::m_state [protected] |
State of the object.
Reimplemented from Service.
Definition at line 55 of file MinimalEventLoopMgr.h.
bool MinimalEventLoopMgr::m_scheduledStop [protected] |
Instance of the incident listener waiting for AbortEvent.
Definition at line 59 of file MinimalEventLoopMgr.h.
bool MinimalEventLoopMgr::m_abortEvent [protected] |
Flag signalling that the event being processedhas to be aborted (skip all following top algs).
Definition at line 62 of file MinimalEventLoopMgr.h.
std::string MinimalEventLoopMgr::m_abortEventSource [protected] |
IntegerProperty Service::m_outputLevel [protected, inherited] |
Gaudi::StateMachine::State Service::m_targetState [protected, inherited] |
IMessageSvc* Service::m_messageSvc [mutable, protected, inherited] |