All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Service Class Reference

Base class for all services. More...

#include <GaudiKernel/Service.h>

Inheritance diagram for Service:
Collaboration diagram for Service:

Public Types

typedef
Gaudi::PluginService::Factory
< IService *, const
std::string &, ISvcLocator * > 
Factory
 
- Public Types inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
typedef CommonMessaging base_class
 
- Public Types inherited from implements3< IService, IProperty, IStateful >
typedef implements3 base_class
 Typedef to this class. More...
 
typedef extend_interfaces3
< IService, IProperty,
IStateful
extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from extend_interfaces3< IService, IProperty, IStateful >
typedef mpl::fold< typename
IService::iid::iids::type,
typename mpl::fold< typename
IProperty::iid::iids::type,
typename
IStateful::iid::iids::type,
mpl::insert< mpl::_1, mpl::_2 >
>::type, mpl::insert< mpl::_1,
mpl::_2 > >::type 
ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IInterface
enum  Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR }
 Return status. More...
 
typedef Gaudi::InterfaceId
< IInterface, 0, 0 > 
iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 

Public Member Functions

virtual unsigned long release ()
 Release Interface instance. More...
 
virtual const std::string & name () const
 Retrieve name of the service. More...
 
virtual StatusCode configure ()
 Configuration (from OFFLINE to CONFIGURED). More...
 
virtual StatusCode initialize ()
 Initialization (from CONFIGURED to INITIALIZED). More...
 
virtual StatusCode start ()
 Start (from INITIALIZED to RUNNING). More...
 
virtual StatusCode stop ()
 Stop (from RUNNING to INITIALIZED). More...
 
virtual StatusCode finalize ()
 Finalize (from INITIALIZED to CONFIGURED). More...
 
virtual StatusCode terminate ()
 Initialization (from CONFIGURED to OFFLINE). More...
 
virtual Gaudi::StateMachine::State FSMState () const
 Get the current state. More...
 
virtual Gaudi::StateMachine::State targetFSMState () const
 When we are in the middle of a transition, get the state where the transition is leading us. More...
 
virtual StatusCode reinitialize ()
 Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED). More...
 
virtual StatusCode restart ()
 Initialization (from RUNNING to RUNNING, via INITIALIZED). More...
 
virtual StatusCode sysInitialize ()
 Initialize Service. More...
 
virtual StatusCode sysStart ()
 Initialize Service. More...
 
virtual StatusCode sysStop ()
 Initialize Service. More...
 
virtual StatusCode sysFinalize ()
 Finalize Service. More...
 
virtual StatusCode sysReinitialize ()
 Re-initialize the Service. More...
 
virtual StatusCode sysRestart ()
 Re-initialize the Service. More...
 
virtual StatusCode setProperty (const Property &p)
 Set the property by property. More...
 
virtual StatusCode setProperty (const std::string &s)
 Set the property by string. More...
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Set the property by std::string. More...
 
virtual StatusCode getProperty (Property *p) const
 Get the property by property. More...
 
virtual const PropertygetProperty (const std::string &name) const
 Get the property by name. More...
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Get the property by std::string. More...
 
virtual const std::vector
< Property * > & 
getProperties () const
 Get list of properties. More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
 Service (const std::string &name, ISvcLocator *svcloc)
 Standard Constructor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const
 Retrieve pointer to service locator. More...
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified for the job. More...
 
template<class T >
StatusCode service (const std::string &name, const T *&psvc, bool createIf=true) const
 Access a service by name, creating it if it doesn't already exist. More...
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
 
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. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
- Public Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
 CommonMessaging (const A1 &a1, const A2 &a2, const A3 &a3)
 Templated constructor with 3 arguments. More...
 
 CommonMessaging (const A1 &a1, const A2 &a2)
 Templated constructor with 2 arguments. More...
 
 CommonMessaging (const A1 &a1)
 Templated constructor with 1 argument. More...
 
 CommonMessaging ()
 Default constructor. More...
 
virtual ~CommonMessaging ()
 Virtual destructor. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
- Public Member Functions inherited from extend_interfaces3< IService, IProperty, IStateful >
virtual ~extend_interfaces3 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IService
 DeclareInterfaceID (IService, 3, 0)
 InterfaceID. More...
 
virtual ~IService ()
 virtual destructor More...
 
- Public Member Functions inherited from INamedInterface
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes). More...
 
- Public Member Functions inherited from IInterface
virtual void * i_cast (const InterfaceID &) const =0
 main cast function More...
 
virtual std::vector< std::string > getInterfaceNames () const =0
 Returns a vector of strings containing the names of all the implemented interfaces. More...
 
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)=0
 Set the void** to the pointer to the requested interface of the instance. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IProperty
 DeclareInterfaceID (IProperty, 2, 0)
 InterfaceID. More...
 
- Public Member Functions inherited from IStateful
 DeclareInterfaceID (IStateful, 1, 0)
 InterfaceID. More...
 
virtual ~IStateful ()
 

Protected Member Functions

virtual ~Service ()
 Standard Destructor. More...
 
int outputLevel () const
 get the Service's output level More...
 
- Protected Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 

Protected Attributes

IntegerProperty m_outputLevel
 Service output level. More...
 
Gaudi::StateMachine::State m_state
 Service state. More...
 
Gaudi::StateMachine::State m_targetState
 Service state. More...
 
- Protected Attributes inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
SmartIF< IMessageSvcm_msgsvc
 Pointer to the message service;. More...
 
std::auto_ptr< MsgStreamm_msgStream
 The predefined message stream. More...
 
bool m_streamWithService
 Flag to create a new MsgStream if it was created without the message service. More...
 

Private Member Functions

void setServiceManager (ISvcManager *ism)
 
void initOutputLevel (Property &prop)
 callback for output level property More...
 

Private Attributes

std::string m_name
 Service Name. More...
 
SmartIF< ISvcLocatorm_svcLocator
 Service Locator reference. More...
 
SmartIF< ISvcManagerm_svcManager
 
PropertyMgrm_propertyMgr
 Property Manager. More...
 
SmartIF< IAuditorSvcm_pAuditorSvc
 Auditor Service. More...
 
BooleanProperty m_auditInit
 
bool m_auditorInitialize
 
bool m_auditorStart
 
bool m_auditorStop
 
bool m_auditorFinalize
 
bool m_auditorReinitialize
 
bool m_auditorRestart
 

Friends

class ServiceManager
 

Additional Inherited Members

- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 

Detailed Description

Base class for all services.

It implements the IService and IProperty interfaces.

Author
Pere Mato
Marco Clemencic

Definition at line 33 of file Service.h.

Member Typedef Documentation

Definition at line 38 of file Service.h.

Constructor & Destructor Documentation

Service::Service ( const std::string &  name,
ISvcLocator svcloc 
)

Standard Constructor.

Definition at line 393 of file Service.cpp.

393  {
394  m_name = name;
395  m_svcLocator = svcloc;
398  m_propertyMgr = new PropertyMgr();
400  // Declare common Service properties with their defaults
401  if ( (name != "MessageSvc") && msgSvc().isValid() ) {
402  // In genconf a service is instantiated without the ApplicationMgr
403  m_outputLevel = msgSvc()->outputLevel();
404  }
405  declareProperty("OutputLevel", m_outputLevel);
407 
408  // Get the default setting for service auditing from the AppMgr
409  declareProperty("AuditServices", m_auditInit = true);
410 
411  bool audit(false);
412  SmartIF<IProperty> appMgr(serviceLocator()->service("ApplicationMgr"));
413  if (appMgr.isValid()) {
414  const Property& prop = appMgr->getProperty("AuditServices");
415  if (m_name != "IncidentSvc") {
416  setProperty(prop).ignore();
417  audit = m_auditInit.value();
418  } else {
419  audit = false;
420  }
421  }
422 
423  declareProperty( "AuditInitialize" , m_auditorInitialize = audit );
424  declareProperty( "AuditStart" , m_auditorStart = audit );
425  declareProperty( "AuditStop" , m_auditorStop = audit );
426  declareProperty( "AuditFinalize" , m_auditorFinalize = audit );
427  declareProperty( "AuditReInitialize" , m_auditorReinitialize = audit );
428  declareProperty( "AuditReStart" , m_auditorRestart = audit );
429 }
BooleanProperty m_auditInit
Definition: Service.h:265
Gaudi::StateMachine::State m_targetState
Service state.
Definition: Service.h:247
IntegerProperty m_outputLevel
Service output level.
Definition: Service.h:243
bool m_auditorInitialize
Definition: Service.h:266
Gaudi::StateMachine::State m_state
Service state.
Definition: Service.h:245
virtual StatusCode setProperty(const Property &p)
Set the property by property.
Definition: Service.cpp:342
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
SmartIF< ISvcLocator > m_svcLocator
Service Locator reference.
Definition: Service.h:256
std::string m_name
Service Name.
Definition: Service.h:254
Property manager helper class.
Definition: PropertyMgr.h:38
virtual void declareUpdateHandler(PropertyCallbackFunctor *pf)
set new callback for update
Definition: Property.cpp:141
bool m_auditorFinalize
Definition: Service.h:269
bool m_auditorReinitialize
Definition: Service.h:270
const TYPE & value() const
explicit conversion
Definition: Property.h:355
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
PropertyMgr * m_propertyMgr
Property Manager.
Definition: Service.h:259
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:43
bool m_auditorStart
Definition: Service.h:267
void initOutputLevel(Property &prop)
callback for output level property
Definition: Service.cpp:432
tuple appMgr
Definition: IOTest.py:83
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:142
void ignore() const
Definition: StatusCode.h:107
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:211
bool m_auditorRestart
Definition: Service.h:271
bool m_auditorStop
Definition: Service.h:268
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Service.cpp:336
Service::~Service ( )
protectedvirtual

Standard Destructor.

Definition at line 440 of file Service.cpp.

440  {
441  delete m_propertyMgr;
442 }
PropertyMgr * m_propertyMgr
Property Manager.
Definition: Service.h:259

Member Function Documentation

SmartIF< IAuditorSvc > & Service::auditorSvc ( ) const

The standard auditor service.May not be invoked before sysInitialize() has been invoked.

Definition at line 444 of file Service.cpp.

444  {
445  if ( !m_pAuditorSvc.isValid() ) {
446  m_pAuditorSvc = serviceLocator()->service("AuditorSvc");
447  if( !m_pAuditorSvc.isValid() ) {
448  throw GaudiException("Service [AuditorSvc] not found", name(), StatusCode::FAILURE);
449  }
450  }
451  return m_pAuditorSvc;
452 }
Define general base for Gaudi exception.
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
Definition: Service.h:264
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:51
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Service.cpp:336
virtual StatusCode Service::configure ( )
inlinevirtual

Configuration (from OFFLINE to CONFIGURED).

Implements IService.

Definition at line 50 of file Service.h.

template<class T >
Property* Service::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
) const
inline

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 for property #1" ) ;
// declare the property and attach the handler to it
declareProperty( "Property2" , m_property2 , "Doc for property #2" )
-> declareUpdateHandler( &MySvc::handler_2 ) ;
}
See also
PropertyMgr
PropertyMgr::declareProperty
Parameters
namethe property name
propertythe property itself,
docthe documentation string
Returns
the actual property objects

Definition at line 211 of file Service.h.

214  {
215  return m_propertyMgr -> declareProperty ( name , property , doc ) ;
216  }
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
PropertyMgr * m_propertyMgr
Property Manager.
Definition: Service.h:259
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:211
Property* Service::declareRemoteProperty ( const std::string &  name,
IProperty rsvc,
const std::string &  rname = "" 
) const
inline

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
nameLocal property name
rsvcRemote IProperty interface
rnameName of the property at remote service

Definition at line 227 of file Service.h.

230  {
231  return m_propertyMgr -> declareRemoteProperty ( name , rsvc , rname ) ;
232  }
Property * declareRemoteProperty(const std::string &name, IProperty *rsvc, const std::string &rname="") const
Declare remote named properties.
Definition: Service.h:227
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
PropertyMgr * m_propertyMgr
Property Manager.
Definition: Service.h:259
virtual Gaudi::StateMachine::State Service::FSMState ( ) const
inlinevirtual

Get the current state.

Implements IService.

Definition at line 56 of file Service.h.

56 { return m_state; }
Gaudi::StateMachine::State m_state
Service state.
Definition: Service.h:245
const std::vector< Property * > & Service::getProperties ( ) const
virtual

Get list of properties.

Implements IProperty.

Definition at line 366 of file Service.cpp.

366  {
367  return m_propertyMgr->getProperties();
368 }
PropertyMgr * m_propertyMgr
Property Manager.
Definition: Service.h:259
const std::vector< Property * > & getProperties() const
get all properties
StatusCode Service::getProperty ( Property p) const
virtual

Get the property by property.

Implements IProperty.

Reimplemented in JobOptionsSvc.

Definition at line 354 of file Service.cpp.

354  {
355  return m_propertyMgr->getProperty(p);
356 }
StatusCode getProperty(Property *p) const
get the property
PropertyMgr * m_propertyMgr
Property Manager.
Definition: Service.h:259
const Property & Service::getProperty ( const std::string &  name) const
virtual

Get the property by name.

Implements IProperty.

Definition at line 358 of file Service.cpp.

358  {
359  return m_propertyMgr->getProperty(n);
360 }
StatusCode getProperty(Property *p) const
get the property
PropertyMgr * m_propertyMgr
Property Manager.
Definition: Service.h:259
StatusCode Service::getProperty ( const std::string &  n,
std::string &  v 
) const
virtual

Get the property by std::string.

Implements IProperty.

Definition at line 362 of file Service.cpp.

362  {
363  return m_propertyMgr->getProperty(n,v);
364 }
StatusCode getProperty(Property *p) const
get the property
PropertyMgr * m_propertyMgr
Property Manager.
Definition: Service.h:259
StatusCode Service::initialize ( )
virtual

Initialization (from CONFIGURED to INITIALIZED).

Implements IService.

Reimplemented in MultiStoreSvc, DataSvc, Gaudi::Utils::StopSignalHandler, PersistencySvc, HistogramSvc, DataOnDemandSvc, Gaudi::RootCnvSvc, GslSvc, EventCollectionSelector, EventSelector, ConversionSvc, Gaudi::RootPerfMonSvc, Gaudi::ParticlePropertySvc, Gaudi::IODataManager, MinimalEventLoopMgr, EventLoopMgr, RndmGenSvc, Gaudi::MultiFileCatalog, IncidentSvc, RndmEngine, HistogramPersistencySvc, Gaudi::RootEvtSelector, IoComponentMgr, MessageSvc, HistorySvc, AlgContextSvc, ChronoStatSvc, AppMgrRunable, EvtPersistencySvc, NTupleSvc, StalledEventMonitor, ExceptionSvc, FileMgr, HepRndm::Engine< TYPE >, DetDataSvc, JobOptionsSvc, TagCollectionSvc, ToolSvc, THistSvc, AuditorSvc, RecordDataSvc, VFSSvc, PartPropSvc, PythonScriptingSvc, RootHistCnv::PersSvc, IssueLogger, EvtDataSvc, StatusCodeSvc, and DetPersistencySvc.

Definition at line 74 of file Service.cpp.

74  {
75  // Set the Algorithm's properties
77  ON_DEBUG debug() << "Service base class initialized successfully" << endmsg;
79  return sc ;
80 }
Gaudi::StateMachine::State m_state
Service state.
Definition: Service.h:245
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
StatusCode setProperties()
Method for setting declared properties to the values specified for the job.
Definition: Service.cpp:371
#define ON_DEBUG
Definition: Service.cpp:19
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition: StateMachine.cpp:8
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
void Service::initOutputLevel ( Property prop)
private

callback for output level property

Definition at line 432 of file Service.cpp.

432  {
433  if ( (name() != "MessageSvc") && msgSvc().isValid() ) {
434  msgSvc()->setOutputLevel( name(), m_outputLevel );
435  }
437 }
IntegerProperty m_outputLevel
Service output level.
Definition: Service.h:243
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
void updateMsgStreamOutputLevel(int level)
Update the output level of the cached MsgStream.
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
const std::string & Service::name ( ) const
virtual

Retrieve name of the service.

Implements CommonMessaging< implements3< IService, IProperty, IStateful > >.

Definition at line 331 of file Service.cpp.

331  {
332  return m_name;
333 }
std::string m_name
Service Name.
Definition: Service.h:254
int Service::outputLevel ( ) const
inlineprotected

get the Service's output level

Definition at line 250 of file Service.h.

250 { return m_outputLevel.value(); }
IntegerProperty m_outputLevel
Service output level.
Definition: Service.h:243
const TYPE & value() const
explicit conversion
Definition: Property.h:355
StatusCode Service::reinitialize ( )
virtual

Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).

Implements IService.

Reimplemented in MultiStoreSvc, DataSvc, HistogramSvc, DataOnDemandSvc, EventSelector, MinimalEventLoopMgr, EventLoopMgr, HistogramPersistencySvc, HistorySvc, MessageSvc, NTupleSvc, DetDataSvc, THistSvc, RecordDataSvc, PartPropSvc, IssueLogger, EvtDataSvc, and StatusCodeSvc.

Definition at line 294 of file Service.cpp.

294  {
295  /* @TODO
296  * MCl 2008-10-23: the implementation of reinitialize as finalize+initialize
297  * is causing too many problems
298  *
299  // Default implementation is finalize+initialize
300  StatusCode sc = finalize();
301  if (sc.isFailure()) {
302  error() << "reinitialize(): cannot be finalized" << endmsg;
303  return sc;
304  }
305  sc = initialize();
306  if (sc.isFailure()) {
307  error() << "reinitialize(): cannot be initialized" << endmsg;
308  return sc;
309  }
310  */
311  return StatusCode::SUCCESS;
312 }
unsigned long Service::release ( )
virtual

Release Interface instance.

Specialized implementation because the default one is not enough.

Implements IInterface.

Definition at line 24 of file Service.cpp.

24  {
25  // Avoid to decrement 0
26  const unsigned long count = (m_refCount) ? --m_refCount : m_refCount;
27  if( count == 0) {
28  if (m_svcManager!=0) {
29  m_svcManager->removeService(this).ignore();
30  }
31  delete this;
32  }
33  return count;
34 }
SmartIF< ISvcManager > m_svcManager
Definition: Service.h:257
StatusCode Service::restart ( )
virtual

Initialization (from RUNNING to RUNNING, via INITIALIZED).

Implements IService.

Reimplemented in MinimalEventLoopMgr.

Definition at line 315 of file Service.cpp.

315  {
316  // Default implementation is stop+start
317  StatusCode sc = stop();
318  if (sc.isFailure()) {
319  error() << "restart(): cannot be stopped" << endmsg;
320  return sc;
321  }
322  sc = start();
323  if (sc.isFailure()) {
324  error() << "restart(): cannot be started" << endmsg;
325  return sc;
326  }
327  return StatusCode::SUCCESS;
328 }
virtual StatusCode stop()
Stop (from RUNNING to INITIALIZED).
Definition: Service.cpp:152
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:85
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode start()
Start (from INITIALIZED to RUNNING).
Definition: Service.cpp:158
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
template<class T >
StatusCode Service::service ( const std::string &  name,
const T *&  psvc,
bool  createIf = true 
) const
inline

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

Definition at line 142 of file Service.h.

142  {
143  ISvcLocator& svcLoc = *serviceLocator();
144  SmartIF<T> ptr(
145  ServiceLocatorHelper(svcLoc, *this).service(name, !createIf, // quiet
146  createIf));
147  if (ptr.isValid()) {
148  psvc = ptr.get();
149  const_cast<T*>(psvc)->addRef();
150  return StatusCode::SUCCESS;
151  }
152  // else
153  psvc = 0;
154  return StatusCode::FAILURE;
155  }
an helper to share the implementation of service() among the various kernel base classes $Id: ...
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:14
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:26
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:142
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Service.cpp:336
template<class T >
StatusCode Service::service ( const std::string &  name,
T *&  psvc,
bool  createIf = true 
) const
inline

Definition at line 158 of file Service.h.

158  {
159  ISvcLocator& svcLoc = *serviceLocator();
160  SmartIF<T> ptr(
161  ServiceLocatorHelper(svcLoc, *this).service(name, !createIf, // quiet
162  createIf));
163  if (ptr.isValid()) {
164  psvc = ptr.get();
165  psvc->addRef();
166  return StatusCode::SUCCESS;
167  }
168  // else
169  psvc = 0;
170  return StatusCode::FAILURE;
171  }
an helper to share the implementation of service() among the various kernel base classes $Id: ...
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:14
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:26
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:142
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Service.cpp:336
template<class T >
StatusCode Service::service ( const std::string &  svcType,
const std::string &  svcName,
T *&  psvc 
) const
inline

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

Definition at line 176 of file Service.h.

177  {
178  return service(svcType + "/" + svcName, psvc);
179  }
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:142
SmartIF< ISvcLocator > & Service::serviceLocator ( ) const
virtual

Retrieve pointer to service locator.

Implements CommonMessaging< implements3< IService, IProperty, IStateful > >.

Definition at line 336 of file Service.cpp.

336  {
337  return m_svcLocator;
338 }
SmartIF< ISvcLocator > m_svcLocator
Service Locator reference.
Definition: Service.h:256
StatusCode Service::setProperties ( )

Method for setting declared properties to the values specified for the job.

Definition at line 371 of file Service.cpp.

371  {
372  const bool CREATEIF(true);
373  SmartIF<IJobOptionsSvc> jos(serviceLocator()->service("JobOptionsSvc", CREATEIF));
374  if( !jos.isValid() ) {
375  throw GaudiException("Service [JobOptionsSvc] not found", name(), StatusCode::FAILURE);
376  }
377  // set first generic Properties
378  StatusCode sc = jos->setMyProperties( getGaudiThreadGenericName(name()), this );
379  if( sc.isFailure() ) return sc;
380 
381  // set specific Properties
382  if (isGaudiThreaded(name())) {
383  if (jos->setMyProperties( name(), this ).isFailure()) {
384  return StatusCode::FAILURE;
385  }
386  }
387  return StatusCode::SUCCESS;
388 }
Define general base for Gaudi exception.
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:85
GAUDI_API bool isGaudiThreaded(const std::string &name)
test if current Gaudi object is running /will run in a thread
Definition: ThreadGaudi.cpp:75
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:142
GAUDI_API std::string getGaudiThreadGenericName(const std::string &name)
helper function to extract Gaudi instance name from thread copy name
Definition: ThreadGaudi.cpp:52
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Service.cpp:336
StatusCode Service::setProperty ( const Property p)
virtual

Set the property by property.

Implements IProperty.

Reimplemented in JobOptionsSvc.

Definition at line 342 of file Service.cpp.

342  {
343  return m_propertyMgr->setProperty(p);
344 }
StatusCode setProperty(const Property &p)
set the property form another property
PropertyMgr * m_propertyMgr
Property Manager.
Definition: Service.h:259
StatusCode Service::setProperty ( const std::string &  s)
virtual

Set the property by string.

Implements IProperty.

Definition at line 346 of file Service.cpp.

346  {
347  return m_propertyMgr->setProperty(s);
348 }
StatusCode setProperty(const Property &p)
set the property form another property
PropertyMgr * m_propertyMgr
Property Manager.
Definition: Service.h:259
string s
Definition: gaudirun.py:210
StatusCode Service::setProperty ( const std::string &  n,
const std::string &  v 
)
virtual

Set the property by std::string.

Implements IProperty.

Definition at line 350 of file Service.cpp.

350  {
351  return m_propertyMgr->setProperty(n,v);
352 }
StatusCode setProperty(const Property &p)
set the property form another property
PropertyMgr * m_propertyMgr
Property Manager.
Definition: Service.h:259
template<class TYPE >
StatusCode Service::setProperty ( const std::string &  name,
const TYPE &  value 
)
inline

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 convenient 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
namename of the property
valuevalue of the property
See also
Gaudi::Utils::setProperty
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-05-13

Definition at line 125 of file Service.h.

StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1212
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
PropertyMgr * m_propertyMgr
Property Manager.
Definition: Service.h:259
void Service::setServiceManager ( ISvcManager ism)
privatevirtual

Implements IService.

Definition at line 455 of file Service.cpp.

455  {
456  m_svcManager = ism;
457 }
SmartIF< ISvcManager > m_svcManager
Definition: Service.h:257
StatusCode Service::start ( )
virtual

Start (from INITIALIZED to RUNNING).

Implements IService.

Reimplemented in MinimalEventLoopMgr, AppMgrRunable, StalledEventMonitor, and ToolSvc.

Definition at line 158 of file Service.cpp.

158  {
159  // stub implementation
160  return StatusCode::SUCCESS;
161 }
StatusCode Service::stop ( )
virtual

Stop (from RUNNING to INITIALIZED).

Implements IService.

Reimplemented in Gaudi::RootPerfMonSvc, MinimalEventLoopMgr, EventLoopMgr, HistorySvc, StalledEventMonitor, AppMgrRunable, and ToolSvc.

Definition at line 152 of file Service.cpp.

152  {
153  // stub implementation
154  return StatusCode::SUCCESS;
155 }
StatusCode Service::sysFinalize ( )
virtual

Finalize Service.

Implements IService.

Reimplemented in AuditorSvc.

Definition at line 164 of file Service.cpp.

164  {
165 
167 
168  try {
170  Gaudi::Guards::AuditorGuard guard(this,
171  // check if we want to audit the initialize
172  (m_auditorFinalize) ? auditorSvc().get() : 0,
174  sc = finalize();
175  if (sc.isSuccess())
177  }
178  catch( const GaudiException& Exception ) {
179  fatal() << " Exception with tag=" << Exception.tag()
180  << " is caught " << endmsg;
181  error() << Exception << endmsg;
182  // Stat stat( chronoSvc() , Exception.tag() ) ;
183  }
184  catch( const std::exception& Exception ) {
185  fatal() << " Standard std::exception is caught " << endmsg;
186  error() << Exception.what() << endmsg;
187  // Stat stat( chronoSvc() , "*std::exception*" ) ;
188  }
189  catch( ... ) {
190  fatal() << "UNKNOWN Exception is caught " << endmsg;
191  // Stat stat( chronoSvc() , "*UNKNOWN Exception*" ) ;
192  }
193 
194  m_pAuditorSvc = 0;
195  return sc;
196 }
Gaudi::StateMachine::State m_targetState
Service state.
Definition: Service.h:247
Define general base for Gaudi exception.
Gaudi::StateMachine::State m_state
Service state.
Definition: Service.h:245
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
Definition: Service.h:264
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Service.cpp:444
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual const std::string & tag() const
name tag for the exception, or exception type
bool m_auditorFinalize
Definition: Service.h:269
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:218
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
Definition: Service.cpp:199
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode Service::sysInitialize ( )
virtual

Initialize Service.

Implements IService.

Reimplemented in AuditorSvc.

Definition at line 37 of file Service.cpp.

37  {
38  StatusCode sc;
39 
40  try {
42  Gaudi::Guards::AuditorGuard guard(this,
43  // check if we want to audit the initialize
44  (m_auditorInitialize) ? auditorSvc().get() : 0,
46  if ((name() != "MessageSvc") && msgSvc().isValid()) // pre-set the outputLevel from the MessageSvc value
47  m_outputLevel = msgSvc()->outputLevel(name());
48  sc = initialize(); // This should change the state to Gaudi::StateMachine::CONFIGURED
49  if (sc.isSuccess())
51  return sc;
52  }
53  catch ( const GaudiException& Exception ) {
54  fatal() << "in sysInitialize(): exception with tag=" << Exception.tag()
55  << " is caught" << endmsg;
56  error() << Exception << endmsg;
57  // Stat stat( chronoSvc() , Exception.tag() );
58  }
59  catch( const std::exception& Exception ) {
60  fatal() << "in sysInitialize(): standard std::exception is caught" << endmsg;
61  error() << Exception.what() << endmsg;
62  // Stat stat( chronoSvc() , "*std::exception*" );
63  }
64  catch(...) {
65  fatal() << "in sysInitialize(): UNKNOWN Exception is caught" << endmsg;
66  // Stat stat( chronoSvc() , "*UNKNOWN Exception*" ) ;
67  }
68 
69  return StatusCode::FAILURE;
70 }
Gaudi::StateMachine::State m_targetState
Service state.
Definition: Service.h:247
IntegerProperty m_outputLevel
Service output level.
Definition: Service.h:243
Define general base for Gaudi exception.
bool m_auditorInitialize
Definition: Service.h:266
Gaudi::StateMachine::State m_state
Service state.
Definition: Service.h:245
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Service.cpp:444
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual const std::string & tag() const
name tag for the exception, or exception type
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
Definition: Service.cpp:74
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:218
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode Service::sysReinitialize ( )
virtual

Re-initialize the Service.

Implements IService.

Definition at line 206 of file Service.cpp.

206  {
207 
208  StatusCode sc;
209 
210  // Check that the current status is the correct one.
212  MsgStream log ( msgSvc() , name() );
213  error()
214  << "sysReinitialize(): cannot reinitialize service not initialized"
215  << endmsg;
216  return StatusCode::FAILURE;
217  }
218 
219  try {
220 
221  Gaudi::Guards::AuditorGuard guard(this,
222  // check if we want to audit the initialize
223  (m_auditorReinitialize) ? auditorSvc().get() : 0,
225  sc = reinitialize();
226  return sc;
227  }
228  catch( const GaudiException& Exception ) {
229  MsgStream log ( msgSvc() , name() + ".sysReinitialize()" );
230  fatal() << " Exception with tag=" << Exception.tag()
231  << " is caught " << endmsg;
232  error() << Exception << endmsg;
233  // Stat stat( chronoSvc() , Exception.tag() ) ;
234  }
235  catch( const std::exception& Exception ) {
236  MsgStream log ( msgSvc() , name() + ".sysReinitialize()" );
237  fatal() << " Standard std::exception is caught " << endmsg;
238  error() << Exception.what() << endmsg;
239  // Stat stat( chronoSvc() , "*std::exception*" ) ;
240  }
241  catch( ... ) {
242  MsgStream log ( msgSvc() , name() + ".sysReinitialize()" );
243  fatal() << "UNKNOWN Exception is caught " << endmsg;
244  // Stat stat( chronoSvc() , "*UNKNOWN Exception*" ) ;
245  }
246  return StatusCode::FAILURE ;
247 
248 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Define general base for Gaudi exception.
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Service.cpp:444
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual const std::string & tag() const
name tag for the exception, or exception type
bool m_auditorReinitialize
Definition: Service.h:270
virtual Gaudi::StateMachine::State FSMState() const
Get the current state.
Definition: Service.h:56
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
virtual StatusCode reinitialize()
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
Definition: Service.cpp:294
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:218
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode Service::sysRestart ( )
virtual

Re-initialize the Service.

Implements IService.

Definition at line 251 of file Service.cpp.

251  {
252 
253  StatusCode sc;
254 
255  // Check that the current status is the correct one.
257  MsgStream log ( msgSvc() , name() );
258  error()
259  << "sysRestart(): cannot restart service in state " << FSMState()
260  << " -- must be RUNNING "
261  << endmsg;
262  return StatusCode::FAILURE;
263  }
264 
265  try {
266 
267  Gaudi::Guards::AuditorGuard guard(this,
268  // check if we want to audit the initialize
269  (m_auditorRestart) ? auditorSvc().get() : 0,
271  sc = restart();
272  return sc;
273  }
274  catch( const GaudiException& Exception ) {
275  fatal() << " Exception with tag=" << Exception.tag()
276  << " is caught " << endmsg;
277  error() << Exception << endmsg;
278  // Stat stat( chronoSvc() , Exception.tag() ) ;
279  }
280  catch( const std::exception& Exception ) {
281  fatal() << " Standard std::exception is caught " << endmsg;
282  error() << Exception.what() << endmsg;
283  // Stat stat( chronoSvc() , "*std::exception*" ) ;
284  }
285  catch( ... ) {
286  fatal() << "UNKNOWN Exception is caught " << endmsg;
287  // Stat stat( chronoSvc() , "*UNKNOWN Exception*" ) ;
288  }
289  return StatusCode::FAILURE ;
290 
291 }
virtual StatusCode restart()
Initialization (from RUNNING to RUNNING, via INITIALIZED).
Definition: Service.cpp:315
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Define general base for Gaudi exception.
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Service.cpp:444
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual const std::string & tag() const
name tag for the exception, or exception type
virtual Gaudi::StateMachine::State FSMState() const
Get the current state.
Definition: Service.h:56
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:218
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
bool m_auditorRestart
Definition: Service.h:271
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode Service::sysStart ( )
virtual

Initialize Service.

Implements IService.

Definition at line 83 of file Service.cpp.

83  {
84  StatusCode sc;
85 
86  try {
88  Gaudi::Guards::AuditorGuard guard(this,
89  // check if we want to audit the initialize
90  (m_auditorStart) ? auditorSvc().get() : 0,
92  sc = start();
93  if (sc.isSuccess())
95  return sc;
96  }
97  catch ( const GaudiException& Exception ) {
98  fatal() << "in sysStart(): exception with tag=" << Exception.tag()
99  << " is caught" << endmsg;
100  error() << Exception << endmsg;
101  // Stat stat( chronoSvc() , Exception.tag() );
102  }
103  catch( const std::exception& Exception ) {
104  fatal() << "in sysStart(): standard std::exception is caught" << endmsg;
105  fatal() << Exception.what() << endmsg;
106  // Stat stat( chronoSvc() , "*std::exception*" );
107  }
108  catch(...) {
109  fatal() << "in sysStart(): UNKNOWN Exception is caught" << endmsg;
110  // Stat stat( chronoSvc() , "*UNKNOWN Exception*" ) ;
111  }
112 
113  return StatusCode::FAILURE;
114 }
Gaudi::StateMachine::State m_targetState
Service state.
Definition: Service.h:247
Define general base for Gaudi exception.
Gaudi::StateMachine::State m_state
Service state.
Definition: Service.h:245
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Service.cpp:444
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual const std::string & tag() const
name tag for the exception, or exception type
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition: StateMachine.cpp:8
bool m_auditorStart
Definition: Service.h:267
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
virtual StatusCode start()
Start (from INITIALIZED to RUNNING).
Definition: Service.cpp:158
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:218
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode Service::sysStop ( )
virtual

Initialize Service.

Implements IService.

Definition at line 117 of file Service.cpp.

117  {
118  StatusCode sc;
119 
120  try {
122  Gaudi::Guards::AuditorGuard guard(this,
123  // check if we want to audit the initialize
124  (m_auditorStop) ? auditorSvc().get() : 0,
126  sc = stop();
127  if (sc.isSuccess())
129  return sc;
130  }
131  catch ( const GaudiException& Exception ) {
132  fatal() << "in sysStop(): exception with tag=" << Exception.tag()
133  << " is caught" << endmsg;
134  error() << Exception << endmsg;
135  // Stat stat( chronoSvc() , Exception.tag() );
136  }
137  catch( const std::exception& Exception ) {
138  fatal() << "in sysStop(): standard std::exception is caught" << endmsg;
139  error() << Exception.what() << endmsg;
140  // Stat stat( chronoSvc() , "*std::exception*" );
141  }
142  catch(...) {
143  fatal() << "in sysStop(): UNKNOWN Exception is caught" << endmsg;
144  // Stat stat( chronoSvc() , "*UNKNOWN Exception*" ) ;
145  }
146 
147  return StatusCode::FAILURE;
148 }
Gaudi::StateMachine::State m_targetState
Service state.
Definition: Service.h:247
Define general base for Gaudi exception.
Gaudi::StateMachine::State m_state
Service state.
Definition: Service.h:245
virtual StatusCode stop()
Stop (from RUNNING to INITIALIZED).
Definition: Service.cpp:152
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Service.cpp:444
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual const std::string & tag() const
name tag for the exception, or exception type
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition: StateMachine.cpp:8
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:218
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
bool m_auditorStop
Definition: Service.h:268
virtual Gaudi::StateMachine::State Service::targetFSMState ( ) const
inlinevirtual

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 57 of file Service.h.

57 { return m_targetState; }
Gaudi::StateMachine::State m_targetState
Service state.
Definition: Service.h:247
virtual StatusCode Service::terminate ( )
inlinevirtual

Initialization (from CONFIGURED to OFFLINE).

Implements IService.

Definition at line 55 of file Service.h.

Friends And Related Function Documentation

friend class ServiceManager
friend

Definition at line 40 of file Service.h.

Member Data Documentation

BooleanProperty Service::m_auditInit
private

Definition at line 265 of file Service.h.

bool Service::m_auditorFinalize
private

Definition at line 269 of file Service.h.

bool Service::m_auditorInitialize
private

Definition at line 266 of file Service.h.

bool Service::m_auditorReinitialize
private

Definition at line 270 of file Service.h.

bool Service::m_auditorRestart
private

Definition at line 271 of file Service.h.

bool Service::m_auditorStart
private

Definition at line 267 of file Service.h.

bool Service::m_auditorStop
private

Definition at line 268 of file Service.h.

std::string Service::m_name
private

Service Name.

Definition at line 254 of file Service.h.

IntegerProperty Service::m_outputLevel
protected

Service output level.

Definition at line 243 of file Service.h.

SmartIF<IAuditorSvc> Service::m_pAuditorSvc
mutableprivate

Auditor Service.

Definition at line 264 of file Service.h.

PropertyMgr* Service::m_propertyMgr
private

Property Manager.

Definition at line 259 of file Service.h.

Gaudi::StateMachine::State Service::m_state
protected

Service state.

Definition at line 245 of file Service.h.

SmartIF<ISvcLocator> Service::m_svcLocator
mutableprivate

Service Locator reference.

Definition at line 256 of file Service.h.

SmartIF<ISvcManager> Service::m_svcManager
private

Definition at line 257 of file Service.h.

Gaudi::StateMachine::State Service::m_targetState
protected

Service state.

Definition at line 247 of file Service.h.


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