| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

MinimalEventLoopMgr Class Reference

This is the default processing manager of the application manager. More...

#include <MinimalEventLoopMgr.h>

Inheritance diagram for MinimalEventLoopMgr:

[legend]
Collaboration diagram for MinimalEventLoopMgr:
[legend]
List of all members.

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 InterfaceIDtype () 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 PropertygetProperty (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.
ISvcLocatorserviceLocator () const
 Retrieve pointer to service locator.
IMessageSvcmsgSvc ()
 Retrieve pointer to message service.
IMessageSvcmsgSvc () const
IMessageSvcmessageService ()
IMessageSvcmessageService () 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>
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property.
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties.
IAuditorSvcauditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked.

Static Public Member Functions

static const InterfaceIDinterfaceID ()
 Retrieve interface ID.
static const InterfaceIDinterfaceID ()
 Retrieve interface ID.
static const InterfaceIDinterfaceID ()
 Retrieve interface ID.
static const InterfaceIDinterfaceID ()
 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

IAppMgrUIm_appMgrUI
 Reference to the IAppMgrUI interface of the application manager.
IIncidentSvcm_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.
IIncidentListenerm_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.
IMessageSvcm_messageSvc
 MessageSvc reference.

Friends

class ServiceManager

Detailed Description

This is the default processing manager of the application manager.

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.

Author:
Markus Frank
Version:
1.0

Definition at line 28 of file MinimalEventLoopMgr.h.


Member Typedef Documentation

typedef std::list<IAlgorithm*> MinimalEventLoopMgr::ListAlg

Creator friend class.

Definition at line 33 of file MinimalEventLoopMgr.h.

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.


Member Enumeration Documentation

enum MinimalEventLoopMgr::State [protected]

Enumerator:
OFFLINE 
CONFIGURED 
FINALIZED 
INITIALIZED 

Definition at line 39 of file MinimalEventLoopMgr.h.

enum IInterface::Status [inherited]

Return status.

Enumerator:
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   };


Constructor & Destructor Documentation

MinimalEventLoopMgr::MinimalEventLoopMgr ( const std::string &  nam,
ISvcLocator svcLoc 
)

Standard Constructor.

virtual MinimalEventLoopMgr::~MinimalEventLoopMgr (  )  [virtual]

Standard Destructor.


Member Function Documentation

template<class T>
T* MinimalEventLoopMgr::releaseInterface ( T *  iface  )  [inline, protected]

Helper to release interface pointer.

Definition at line 75 of file MinimalEventLoopMgr.h.

00075                                                     {
00076     if ( 0 != iface ) iface->release();
00077     return 0;
00078   }

virtual StatusCode MinimalEventLoopMgr::queryInterface ( const InterfaceID riid,
void **  ppvInterface 
) [virtual]

implementation of IInterface: queryInterface

Reimplemented from Service.

virtual StatusCode MinimalEventLoopMgr::initialize (  )  [virtual]

implementation of IService::initalize

Reimplemented from Service.

virtual StatusCode MinimalEventLoopMgr::start (  )  [virtual]

implementation of IService::start

Reimplemented from Service.

virtual StatusCode MinimalEventLoopMgr::stop (  )  [virtual]

implementation of IService::stop

Reimplemented from Service.

virtual StatusCode MinimalEventLoopMgr::finalize (  )  [virtual]

implementation of IService::finalize

Reimplemented from Service.

virtual StatusCode MinimalEventLoopMgr::reinitialize (  )  [virtual]

implementation of IService::reinitialize

Reimplemented from Service.

virtual StatusCode MinimalEventLoopMgr::restart (  )  [virtual]

implementation of IService::restart

Reimplemented from Service.

virtual StatusCode MinimalEventLoopMgr::nextEvent ( int  maxevt  )  [virtual]

implementation of IEventProcessor::nextEvent

Implements IEventProcessor.

virtual StatusCode MinimalEventLoopMgr::executeEvent ( void *  par  )  [virtual]

implementation of IEventProcessor::executeEvent(void* par)

Implements IEventProcessor.

virtual StatusCode MinimalEventLoopMgr::executeRun ( int  maxevt  )  [virtual]

implementation of IEventProcessor::executeRun( )

Implements IEventProcessor.

virtual StatusCode MinimalEventLoopMgr::stopRun (  )  [virtual]

implementation of IEventProcessor::stopRun( )

Implements IEventProcessor.

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]

Reference Interface instance.

Implements IInterface.

virtual unsigned long Service::release (  )  [virtual, inherited]

Release Interface instance.

Implements IInterface.

virtual const std::string& Service::name (  )  const [virtual, inherited]

Retrieve name of the service.

Implements INamedInterface.

virtual const InterfaceID& Service::type (  )  const [virtual, inherited]

Retrieve ID of the Service.

Implements IService.

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]

Get the current state.

Implements IService.

Definition at line 59 of file Service.h.

00059 { return m_state; }

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]

Initilize Service.

Implements IService.

virtual StatusCode Service::sysStart (  )  [virtual, inherited]

Initilize Service.

Implements IService.

virtual StatusCode Service::sysStop (  )  [virtual, inherited]

Initilize Service.

Implements IService.

virtual StatusCode Service::sysFinalize (  )  [virtual, inherited]

Finalize Service.

Implements IService.

virtual StatusCode Service::sysReinitialize (  )  [virtual, inherited]

Re-initialize the Service.

Implements IService.

virtual StatusCode Service::sysRestart (  )  [virtual, inherited]

Re-initialize the Service.

Implements IService.

virtual StatusCode Service::setProperty ( const Property p  )  [virtual, inherited]

Set the property by property.

Implements IProperty.

virtual StatusCode Service::setProperty ( const std::string &  s  )  [virtual, inherited]

Set the property by string.

Implements IProperty.

virtual StatusCode Service::setProperty ( const std::string &  n,
const std::string &  v 
) [virtual, inherited]

Set the property by std::string.

Implements IProperty.

template<class TYPE>
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..

Parameters:
name name of the property
value value of the property
See also:
Gaudi::Utils::setProperty
Author:
Vanya BELYAEV ibelyaev@physics.syr.edu
Date:
2007-05-13

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]

Get the property by property.

Implements IProperty.

virtual const Property& Service::getProperty ( const std::string &  name  )  const [virtual, inherited]

Get the property by name.

Implements IProperty.

virtual StatusCode Service::getProperty ( const std::string &  n,
std::string &  v 
) const [virtual, inherited]

Get the property by std::string.

Implements IProperty.

virtual const std::vector<Property*>& Service::getProperties (  )  const [virtual, inherited]

Get list of properties.

Implements IProperty.

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.

template<class T>
StatusCode Service::service ( const std::string &  name,
T *&  psvc,
bool  createIf = true 
) const [inline, inherited]

Access a service by name, creating it if it doesn't already exist.

Definition at line 152 of file Service.h.

00152                                                                                     {
00153     return service_i(name, createIf, T::interfaceID(), (void**)&psvc);
00154   }

template<class T>
StatusCode Service::service ( const std::string &  svcType,
const std::string &  svcName,
T *&  psvc 
) const [inline, inherited]

Access a service by name and type, creating it if it doesn't already exist.

Definition at line 159 of file Service.h.

00160                                       {
00161     return service_i(svcType, svcName, T::interfaceID(), (void**)&psvc);
00162   }

template<class T>
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 ) ;
  
   }

See also:
PropertyMgr

PropertyMgr::declareProperty

Parameters:
name the property name
proeprty the property itself,
doc the documentation string
Returns:
the actual property objects

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.

Parameters:
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; }


Friends And Related Function Documentation

friend class ServiceManager [friend, inherited]

Reimplemented from IService.

Definition at line 34 of file Service.h.


Member Data Documentation

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]

Reference to the indicent service.

Definition at line 43 of file MinimalEventLoopMgr.h.

ListAlg MinimalEventLoopMgr::m_topAlgList [protected]

List of top level algorithms.

Definition at line 45 of file MinimalEventLoopMgr.h.

ListAlg MinimalEventLoopMgr::m_outStreamList [protected]

List of output streams.

Definition at line 47 of file MinimalEventLoopMgr.h.

std::string MinimalEventLoopMgr::m_outStreamType [protected]

Out Stream type.

Definition at line 49 of file MinimalEventLoopMgr.h.

StringArrayProperty MinimalEventLoopMgr::m_topAlgNames [protected]

List of top level algorithms names.

Definition at line 51 of file MinimalEventLoopMgr.h.

StringArrayProperty MinimalEventLoopMgr::m_outStreamNames [protected]

List of output stream names.

Definition at line 53 of file MinimalEventLoopMgr.h.

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]

Scheduled stop of event processing.

Definition at line 57 of file MinimalEventLoopMgr.h.

IIncidentListener* MinimalEventLoopMgr::m_abortEventListener [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]

Source of the AbortEvent incident.

Definition at line 64 of file MinimalEventLoopMgr.h.

IntegerProperty Service::m_outputLevel [protected, inherited]

Service output level.

Definition at line 226 of file Service.h.

Gaudi::StateMachine::State Service::m_targetState [protected, inherited]

Service state.

Definition at line 230 of file Service.h.

IMessageSvc* Service::m_messageSvc [mutable, protected, inherited]

MessageSvc reference.

Definition at line 232 of file Service.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:57:12 2011 for GaudiKernel by doxygen 1.4.7