| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
Service Class Reference

Base class for all services. More...

`#include <GaudiKernel/Service.h>`

Inheritance diagram for Service:
[legend]
Collaboration diagram for Service:
[legend]

## Public Types
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > | Factory
Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| Typedef used to refer to this class from derived classes, as in. More...
Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using | base_class = CommonMessaging

## Public Member Functions
const std::string & | name () const override
| Retrieve name of the service. More...
StatusCode | configure () override
StatusCode | initialize () override
StatusCode | start () override
StatusCode | stop () override
StatusCode | finalize () override
StatusCode | terminate () override
Gaudi::StateMachine::State | FSMState () const override
Gaudi::StateMachine::State | targetFSMState () const override
StatusCode | reinitialize () override
StatusCode | restart () override
StatusCode | sysInitialize () override
| Initialize Service. More...
StatusCode | sysStart () override
| Initialize Service. More...
StatusCode | sysStop () override
| Initialize Service. More...
StatusCode | sysFinalize () override
| Finalize Service. More...
StatusCode | sysReinitialize () override
| Re-initialize the Service. More...
StatusCode | sysRestart () override
| Re-initialize the Service. More...
| Service (std::string name, ISvcLocator *svcloc)
| Standard Constructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const override
| 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<typename IFace = IService>
SmartIF< IFace > | service (const std::string &name, 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 >
StatusCode | declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used Private tool. More...
template<class T >
StatusCode | declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used Public tool. More...
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| PropertyHolder ()=default
| ~PropertyHolder () override=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Helper to wrap a regular data member and use it as a regular property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none") const
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
| Declare a PropertyBase instance setting name and documentation. More...
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
| Specializations for various GaudiHandles. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...

## Protected Member Functions
| ~Service () override
| Standard Destructor. More...
int | outputLevel () const
| get the `Service's` output level More...
Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Protected Attributes
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::Property< int > | m_outputLevel {this, "OutputLevel", MSG::NIL, "output level"}
Gaudi::Property< bool > | m_auditInit {this, "AuditServices", false, "[[deprecated]] unused"}
Gaudi::Property< bool > | m_auditorInitialize {this, "AuditInitialize", false, "trigger auditor on initialize()"}
Gaudi::Property< bool > | m_auditorStart {this, "AuditStart", false, "trigger auditor on start()"}
Gaudi::Property< bool > | m_auditorStop {this, "AuditStop", false, "trigger auditor on stop()"}
Gaudi::Property< bool > | m_auditorFinalize {this, "AuditFinalize", false, "trigger auditor on finalize()"}
Gaudi::Property< bool > | m_auditorReinitialize {this, "AuditReinitialize", false, "trigger auditor on reinitialize()"}
Gaudi::Property< bool > | m_auditorRestart {this, "AuditRestart", false, "trigger auditor on restart()"}
SmartIF< IAuditorSvc > | m_pAuditorSvc
| Auditor Service. More...

## Private Member Functions
void | sysInitialize_imp ()
void | setServiceManager (ISvcManager *ism) override

## Private Attributes
StatusCode | m_initSC
std::once_flag | m_initFlag
std::string | m_name
| Service Name. More...
SmartIF< ISvcLocator > | m_svcLocator
| Service Locator reference. More...
SmartIF< ISvcManager > | m_svcManager

## Friends
class | ServiceManager

## Detailed Description

Base class for all services.

It implements the IService and IProperty interfaces.

Author
  Pere Mato
  Marco Clemencic

Definition at line 36 of file Service.h.

## Member Typedef Documentation

typedef Gaudi::PluginService::Factory<IService*, const std::string&, ISvcLocator*> Service::Factory

Definition at line 40 of file Service.h.

## Constructor & Destructor Documentation

Service::Service | ( | std::string | name,
|  | ISvcLocator * | svcloc
| ) |  |

Standard Constructor.

Definition at line 324 of file Service.cpp.

324 : m_name( std::move( name ) ), m_svcLocator( svcloc )
325 {
326 if ( m_name != "MessageSvc" ) { // the MessageSvc should not notify itself
327 m_outputLevel.declareUpdateHandler(
328 [this]( Gaudi::Details::PropertyBase& ) { this->updateMsgStreamOutputLevel( this->m_outputLevel ); } );
329 }
330
331 // Initialize the default value from ApplicationMgr AuditAlgorithms
332 Gaudi::Property<bool> audit( false );
333 auto appMgr = serviceLocator()->service<IProperty>( "ApplicationMgr" );
334 if ( appMgr && appMgr->hasProperty( "AuditServices" ) ) {
335 audit.assign( appMgr->getProperty( "AuditServices" ) );
336 }
337 m_auditInit = audit;
338 m_auditorInitialize = audit;
339 m_auditorStart = audit;
340 m_auditorStop = audit;
341 m_auditorFinalize = audit;
342 m_auditorReinitialize = audit;
343 m_auditorRestart = audit;
344 }
Service::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: Service.h:214
Service::m_auditorInitialize
Gaudi::Property< bool > m_auditorInitialize
Definition: Service.h:216
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:314
Service::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Service Locator reference.
Definition: Service.h:206
Service::m_auditInit
Gaudi::Property< bool > m_auditInit
Definition: Service.h:215
Service::m_auditorRestart
Gaudi::Property< bool > m_auditorRestart
Definition: Service.h:221
Service::m_name
std::string m_name
Service Name.
Definition: Service.h:204
Service::m_auditorReinitialize
Gaudi::Property< bool > m_auditorReinitialize
Definition: Service.h:220
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
CommonMessaging< implements< IService, IProperty, IStateful > >::updateMsgStreamOutputLevel
void updateMsgStreamOutputLevel(int level)
Update the output level of the cached MsgStream.
Definition: CommonMessaging.h:186
Service::m_auditorFinalize
Gaudi::Property< bool > m_auditorFinalize
Definition: Service.h:219
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
std::move
T move(T...args)
IOTest.appMgr
appMgr
Definition: IOTest.py:83
Service::m_auditorStart
Gaudi::Property< bool > m_auditorStart
Definition: Service.h:217
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
Service::m_auditorStop
Gaudi::Property< bool > m_auditorStop
Definition: Service.h:218
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292

Service::~Service | ( |  | ) |
| override protected

Standard Destructor.

Definition at line 20 of file Service.cpp.

21 {
22 if ( m_svcManager ) m_svcManager->removeService( this ).ignore();
23 }
Service::m_svcManager
SmartIF< ISvcManager > m_svcManager
Definition: Service.h:207
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:106
ISvcManager::removeService
virtual StatusCode removeService(IService *svc)=0
Remove a service from the "active" list of services of the factory.

## Member Function Documentation

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

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

Definition at line 346 of file Service.cpp.

347 {
348 if ( !m_pAuditorSvc ) {
349 m_pAuditorSvc = serviceLocator()->service( "AuditorSvc" );
350 if ( !m_pAuditorSvc ) {
351 throw GaudiException( "Service [AuditorSvc] not found", name(), StatusCode::FAILURE );
352 }
353 }
354 return m_pAuditorSvc;
355 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
Service::m_pAuditorSvc
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
Definition: Service.h:224
StatusCode::FAILURE
Definition: StatusCode.h:29
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292

StatusCode Service::configure | ( |  | ) |
| inline override

Definition at line 48 of file Service.h.

48 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:30
template<class T >

StatusCode Service::declarePrivateTool | ( | ToolHandle< T > & | handle,
|  | std::string | toolTypeAndName = `""`,
|  | bool | createIf = `true`
| ) |  |
| inline

Declare used Private tool.

Parameters

  handle | ToolHandle<T>
  toolTypeAndName |
  parent,default | public tool
  create | if necessary, default true

Definition at line 137 of file Service.h.

138 {
139
140 if ( toolTypeAndName == "" ) toolTypeAndName = System::typeinfoName( typeid( T ) );
141
142 StatusCode sc = handle.initialize( toolTypeAndName, this, createIf );
143
144 if ( sc.isSuccess() ) {
145 if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
146 debug() << "Handle for private tool" << toolTypeAndName << " successfully created and stored." << endmsg;
147 } else {
148
149 error() << "Handle for private tool" << toolTypeAndName << " could not be created." << endmsg;
150 }
151
152 return sc;
153 }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
MSG::DEBUG
Definition: IMessageSvc.h:18
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ToolHandle::initialize
StatusCode initialize(const std::string &toolTypeAndName, const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:188
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:126
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:135
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
template<class T >

StatusCode Service::declarePublicTool | ( | ToolHandle< T > & | handle,
|  | std::string | toolTypeAndName = `""`,
|  | bool | createIf = `true`
| ) |  |
| inline

Declare used Public tool.

Parameters

  handle | ToolHandle<T>
  toolTypeAndName |
  parent,default | public tool
  create | if necessary, default true

Definition at line 163 of file Service.h.

164 {
165
166 if ( toolTypeAndName == "" ) toolTypeAndName = System::typeinfoName( typeid( T ) );
167
168 StatusCode sc = handle.initialize( toolTypeAndName, 0, createIf );
169
170 if ( sc.isSuccess() ) {
171 if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
172 debug() << "Handle for public tool" << toolTypeAndName << " successfully created and stored." << endmsg;
173 } else {
174
175 error() << "Handle for public tool" << toolTypeAndName << " could not be created." << endmsg;
176 }
177
178 return sc;
179 }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
MSG::DEBUG
Definition: IMessageSvc.h:18
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ToolHandle::initialize
StatusCode initialize(const std::string &toolTypeAndName, const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:188
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:126
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:135
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode Service::finalize | ( |  | ) |
| override

Definition at line 174 of file Service.cpp.

175 {
176 // m_state = Gaudi::StateMachine::ChangeState(Gaudi::StateMachine::TERMINATE,m_state);
177 return StatusCode::SUCCESS;
178 }
StatusCode::SUCCESS
Definition: StatusCode.h:30

Gaudi::StateMachine::State Service::FSMState | ( |  | ) | const
| inline override

Definition at line 54 of file Service.h.

54 { return m_state; }
Service::m_state
Gaudi::StateMachine::State m_state
Service state.
Definition: Service.h:191

StatusCode Service::initialize | ( |  | ) |
| override

Definition at line 64 of file Service.cpp.

65 {
66 ON_DEBUG debug() << "Service base class initialized successfully" << endmsg;
67 m_state = Gaudi::StateMachine::ChangeState( Gaudi::StateMachine::CONFIGURE, m_state );
68 return StatusCode::SUCCESS;
69 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
Service::m_state
Gaudi::StateMachine::State m_state
Service state.
Definition: Service.h:191
Gaudi::StateMachine::CONFIGURE
Definition: StateMachine.h:24
ON_DEBUG
#define ON_DEBUG
Definition: Service.cpp:17
Gaudi::StateMachine::ChangeState
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
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:126
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

const std::string & Service::name | ( |  | ) | const
| override

Retrieve name of the service.

Definition at line 289 of file Service.cpp.

289 { return m_name; }
Service::m_name
std::string m_name
Service Name.
Definition: Service.h:204

int Service::outputLevel | ( |  | ) | const
| inline protected

get the `Service's` output level

Definition at line 196 of file Service.h.

196 { return m_outputLevel.value(); }
Service::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: Service.h:214

StatusCode Service::reinitialize | ( |  | ) |
| override

Definition at line 250 of file Service.cpp.

251 {
252 /* @TODO
253 * MCl 2008-10-23: the implementation of reinitialize as finalize+initialize
254 * is causing too many problems
255 *
256 // Default implementation is finalize+initialize
257 StatusCode sc = finalize();
258 if (sc.isFailure()) {
259 error() << "reinitialize(): cannot be finalized" << endmsg;
260 return sc;
261 }
262 sc = initialize();
263 if (sc.isFailure()) {
264 error() << "reinitialize(): cannot be initialized" << endmsg;
265 return sc;
266 }
267 */
268 return StatusCode::SUCCESS;
269 }
StatusCode::SUCCESS
Definition: StatusCode.h:30

StatusCode Service::restart | ( |  | ) |
| override

Definition at line 272 of file Service.cpp.

273 {
274 // Default implementation is stop+start
275 StatusCode sc = stop();
276 if ( sc.isFailure() ) {
277 error() << "restart(): cannot be stopped" << endmsg;
278 return sc;
279 }
280 sc = start();
281 if ( sc.isFailure() ) {
282 error() << "restart(): cannot be started" << endmsg;
283 return sc;
284 }
285 return StatusCode::SUCCESS;
286 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
Service::start
StatusCode start() override
Definition: Service.cpp:137
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Service::stop
StatusCode stop() override
Definition: Service.cpp:130
endmsg
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 85 of file Service.h.

86 {
87 ISvcLocator& svcLoc = *serviceLocator();
88 auto ptr = ServiceLocatorHelper( svcLoc, *this )
89 .service<T>( name, !createIf, // quiet
90 createIf );
91 if ( ptr ) {
92 psvc = ptr.get();
93 const_cast<T*>( psvc )->addRef();
94 return StatusCode::SUCCESS;
95 }
96 // else
97 psvc = nullptr;
98 return StatusCode::FAILURE;
99 }
ServiceLocatorHelper
an helper to share the implementation of service() among the various kernel base classes ...
Definition: ServiceLocatorHelper.h:17
StatusCode::SUCCESS
Definition: StatusCode.h:30
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
StatusCode::FAILURE
Definition: StatusCode.h:29
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
ServiceLocatorHelper::service
SmartIF< IService > service(const std::string &name, const bool quiet=false, const bool createIf=true) const
Definition: ServiceLocatorHelper.cpp:63
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292
template<class T >

StatusCode Service::service | ( | const std::string & | name,
|  | T *& | psvc,
|  | bool | createIf = `true`
| ) |  | const
| inline

Definition at line 102 of file Service.h.

103 {
104 auto ptr = service<T>( name, createIf );
105 psvc = ( ptr ? ptr.get() : nullptr );
106 if ( psvc ) {
107 psvc->addRef();
108 return StatusCode::SUCCESS;
109 }
110 return StatusCode::FAILURE;
111 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
StatusCode::FAILURE
Definition: StatusCode.h:29
template<typename IFace = IService>

SmartIF<IFace> Service::service | ( | const std::string & | name,
|  | bool | createIf = `true`
| ) |  | const
| inline

Definition at line 114 of file Service.h.

115 {
116 return ServiceLocatorHelper( *serviceLocator(), *this )
117 .service<IFace>( name, !createIf, // quiet
118 createIf );
119 }
ServiceLocatorHelper
an helper to share the implementation of service() among the various kernel base classes ...
Definition: ServiceLocatorHelper.h:17
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
ServiceLocatorHelper::service
SmartIF< IService > service(const std::string &name, const bool quiet=false, const bool createIf=true) const
Definition: ServiceLocatorHelper.cpp:63
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292
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 124 of file Service.h.

125 {
126 return service( svcType + "/" + svcName, psvc );
127 }
Service::service
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn&#39;t already exist.
Definition: Service.h:85

SmartIF< ISvcLocator > & Service::serviceLocator | ( |  | ) | const
| override

Retrieve pointer to service locator.

Definition at line 292 of file Service.cpp.

292 { return m_svcLocator; }
Service::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Service Locator reference.
Definition: Service.h:206

StatusCode Service::setProperties | ( |  | ) |

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

Definition at line 295 of file Service.cpp.

296 {
297 const bool CREATEIF( true );
298 auto jos = serviceLocator()->service<IJobOptionsSvc>( "JobOptionsSvc", CREATEIF );
299 if ( !jos ) {
300 throw GaudiException( "Service [JobOptionsSvc] not found", name(), StatusCode::FAILURE );
301 }
302 // set first generic Properties
303 StatusCode sc = jos->setMyProperties( getGaudiThreadGenericName( name() ), this );
304 if ( sc.isFailure() ) return sc;
305
306 // set specific Properties
307 if ( isGaudiThreaded( name() ) ) {
308 if ( jos->setMyProperties( name(), this ).isFailure() ) {
309 return StatusCode::FAILURE;
310 }
311 }
312 // initialize output level (except for MessageSvc)
313 if ( name() != "MessageSvc" && msgSvc() ) {
314 if ( m_outputLevel == MSG::NIL ) // if not defined (via options)
315 m_outputLevel = msgLevel(); // set it from MessageSvc
316 else // otherwise notify MessageSvc
317 updateMsgStreamOutputLevel( m_outputLevel );
318 }
319 return sc;
320 }
Service::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: Service.h:214
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
isGaudiThreaded
GAUDI_API bool isGaudiThreaded(const std::string &name)
test if current Gaudi object is running /will run in a thread
Definition: ThreadGaudi.cpp:73
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
IJobOptionsSvc
Main interface for the JobOptions service.
Definition: IJobOptionsSvc.h:20
CommonMessaging< implements< IService, IProperty, IStateful > >::updateMsgStreamOutputLevel
void updateMsgStreamOutputLevel(int level)
Update the output level of the cached MsgStream.
Definition: CommonMessaging.h:186
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
MSG::NIL
Definition: IMessageSvc.h:16
CommonMessagingBase::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:70
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:135
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292
getGaudiThreadGenericName
GAUDI_API std::string getGaudiThreadGenericName(const std::string &name)
helper function to extract Gaudi instance name from thread copy name
Definition: ThreadGaudi.cpp:50

void Service::setServiceManager | ( | ISvcManager * | ism | ) |
| override private

Definition at line 357 of file Service.cpp.

357 { m_svcManager = ism; }
Service::m_svcManager
SmartIF< ISvcManager > m_svcManager
Definition: Service.h:207

StatusCode Service::start | ( |  | ) |
| override

Definition at line 137 of file Service.cpp.

138 {
139 // stub implementation
140 return StatusCode::SUCCESS;
141 }
StatusCode::SUCCESS
Definition: StatusCode.h:30

StatusCode Service::stop | ( |  | ) |
| override

Definition at line 130 of file Service.cpp.

131 {
132 // stub implementation
133 return StatusCode::SUCCESS;
134 }
StatusCode::SUCCESS
Definition: StatusCode.h:30

StatusCode Service::sysFinalize | ( |  | ) |
| override

Finalize Service.

Definition at line 144 of file Service.cpp.

145 {
146
147 StatusCode sc( StatusCode::FAILURE );
148
149 try {
150 m_targetState = Gaudi::StateMachine::OFFLINE;
151 Gaudi::Guards::AuditorGuard guard( this,
152 // check if we want to audit the initialize
153 ( m_auditorFinalize ) ? auditorSvc().get() : nullptr, IAuditor::Finalize );
154 sc = finalize();
155 if ( sc.isSuccess() ) m_state = m_targetState;
156 } catch ( const GaudiException& Exception ) {
157 fatal() << " Exception with tag=" << Exception.tag() << " is caught " << endmsg;
158 error() << Exception << endmsg;
159 // Stat stat( chronoSvc() , Exception.tag() ) ;
160 } catch ( const std::exception& Exception ) {
161 fatal() << " Standard std::exception is caught " << endmsg;
162 error() << Exception.what() << endmsg;
163 // Stat stat( chronoSvc() , "*std::exception*" ) ;
164 } catch ( ... ) {
165 fatal() << "UNKNOWN Exception is caught " << endmsg;
166 // Stat stat( chronoSvc() , "*UNKNOWN Exception*" ) ;
167 }
168
169 m_pAuditorSvc = nullptr;
170 return sc;
171 }
Service::m_targetState
Gaudi::StateMachine::State m_targetState
Service state.
Definition: Service.h:193
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
Service::m_state
Gaudi::StateMachine::State m_state
Service state.
Definition: Service.h:191
Service::m_pAuditorSvc
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
Definition: Service.h:224
StatusCode::FAILURE
Definition: StatusCode.h:29
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:174
Service::auditorSvc
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Service.cpp:346
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
std::exception::what
T what(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IAuditor::Finalize
Definition: IAuditor.h:25
Service::m_auditorFinalize
Gaudi::Property< bool > m_auditorFinalize
Definition: Service.h:219
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:119
std::exception
STL class.
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:111
Gaudi::Guards::AuditorGuard
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:13
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode Service::sysInitialize | ( |  | ) |
| override

Initialize Service.

Definition at line 26 of file Service.cpp.

27 {
28 std::call_once( m_initFlag, &Service::sysInitialize_imp, this );
29 return m_initSC;
30 }
Service::sysInitialize_imp
void sysInitialize_imp()
Definition: Service.cpp:32
Service::m_initSC
StatusCode m_initSC
Definition: Service.h:200
std::call_once
T call_once(T...args)
Service::m_initFlag
std::once_flag m_initFlag
Definition: Service.h:201

void Service::sysInitialize_imp | ( |  | ) |
| private

Definition at line 32 of file Service.cpp.

33 {
34
35 try {
36 m_targetState = Gaudi::StateMachine::INITIALIZED;
37 Gaudi::Guards::AuditorGuard guard( this,
38 // check if we want to audit the initialize
39 ( m_auditorInitialize ) ? auditorSvc().get() : nullptr, IAuditor::Initialize );
40
41 m_initSC = setProperties();
42 if ( !m_initSC ) return;
43
44 m_initSC = initialize(); // This should change the state to Gaudi::StateMachine::CONFIGURED
45 if ( m_initSC.isSuccess() ) m_state = m_targetState;
46 return;
47 } catch ( const GaudiException& Exception ) {
48 fatal() << "in sysInitialize(): exception with tag=" << Exception.tag() << " is caught" << endmsg;
49 error() << Exception << endmsg;
50 // Stat stat( chronoSvc() , Exception.tag() );
51 } catch ( const std::exception& Exception ) {
52 fatal() << "in sysInitialize(): standard std::exception is caught" << endmsg;
53 error() << Exception.what() << endmsg;
54 // Stat stat( chronoSvc() , "*std::exception*" );
55 } catch ( ... ) {
56 fatal() << "in sysInitialize(): UNKNOWN Exception is caught" << endmsg;
57 // Stat stat( chronoSvc() , "*UNKNOWN Exception*" ) ;
58 }
59
60 m_initSC = StatusCode::FAILURE;
61 }
Service::m_targetState
Gaudi::StateMachine::State m_targetState
Service state.
Definition: Service.h:193
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:64
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
Service::m_state
Gaudi::StateMachine::State m_state
Service state.
Definition: Service.h:191
Service::m_auditorInitialize
Gaudi::Property< bool > m_auditorInitialize
Definition: Service.h:216
StatusCode::FAILURE
Definition: StatusCode.h:29
Service::auditorSvc
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Service.cpp:346
Service::m_initSC
StatusCode m_initSC
Definition: Service.h:200
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
std::exception::what
T what(T...args)
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:119
std::exception
STL class.
IAuditor::Initialize
Definition: IAuditor.h:25
Service::setProperties
StatusCode setProperties()
Method for setting declared properties to the values specified for the job.
Definition: Service.cpp:295
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:111
Gaudi::Guards::AuditorGuard
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode Service::sysReinitialize | ( |  | ) |
| override

Re-initialize the Service.

Definition at line 181 of file Service.cpp.

182 {
183
184 StatusCode sc;
185
186 // Check that the current status is the correct one.
187 if ( Gaudi::StateMachine::INITIALIZED != FSMState() ) {
188 error() << "sysReinitialize(): cannot reinitialize service not initialized" << endmsg;
189 return StatusCode::FAILURE;
190 }
191
192 try {
193
194 Gaudi::Guards::AuditorGuard guard( this,
195 // check if we want to audit the initialize
196 ( m_auditorReinitialize ) ? auditorSvc().get() : nullptr,
197 IAuditor::ReInitialize );
198 sc = reinitialize();
199 return sc;
200 } catch ( const GaudiException& Exception ) {
201 fatal() << " Exception with tag=" << Exception.tag() << " is caught " << endmsg;
202 error() << Exception << endmsg;
203 // Stat stat( chronoSvc() , Exception.tag() ) ;
204 } catch ( const std::exception& Exception ) {
205 fatal() << " Standard std::exception is caught " << endmsg;
206 error() << Exception.what() << endmsg;
207 // Stat stat( chronoSvc() , "*std::exception*" ) ;
208 } catch ( ... ) {
209 fatal() << "UNKNOWN Exception is caught " << endmsg;
210 // Stat stat( chronoSvc() , "*UNKNOWN Exception*" ) ;
211 }
212 return StatusCode::FAILURE;
213 }
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
StatusCode::FAILURE
Definition: StatusCode.h:29
Service::auditorSvc
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Service.cpp:346
IAuditor::ReInitialize
Definition: IAuditor.h:25
Service::m_auditorReinitialize
Gaudi::Property< bool > m_auditorReinitialize
Definition: Service.h:220
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
std::exception::what
T what(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:119
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:250
std::exception
STL class.
Service::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: Service.h:54
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:111
Gaudi::Guards::AuditorGuard
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode Service::sysRestart | ( |  | ) |
| override

Re-initialize the Service.

Definition at line 216 of file Service.cpp.

217 {
218
219 StatusCode sc;
220
221 // Check that the current status is the correct one.
222 if ( Gaudi::StateMachine::RUNNING != FSMState() ) {
223 error() << "sysRestart(): cannot restart service in state " << FSMState() << " -- must be RUNNING " << endmsg;
224 return StatusCode::FAILURE;
225 }
226
227 try {
228
229 Gaudi::Guards::AuditorGuard guard( this,
230 // check if we want to audit the initialize
231 ( m_auditorRestart ) ? auditorSvc().get() : nullptr, IAuditor::ReStart );
232 sc = restart();
233 return sc;
234 } catch ( const GaudiException& Exception ) {
235 fatal() << " Exception with tag=" << Exception.tag() << " is caught " << endmsg;
236 error() << Exception << endmsg;
237 // Stat stat( chronoSvc() , Exception.tag() ) ;
238 } catch ( const std::exception& Exception ) {
239 fatal() << " Standard std::exception is caught " << endmsg;
240 error() << Exception.what() << endmsg;
241 // Stat stat( chronoSvc() , "*std::exception*" ) ;
242 } catch ( ... ) {
243 fatal() << "UNKNOWN Exception is caught " << endmsg;
244 // Stat stat( chronoSvc() , "*UNKNOWN Exception*" ) ;
245 }
246 return StatusCode::FAILURE;
247 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
StatusCode::FAILURE
Definition: StatusCode.h:29
Service::auditorSvc
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Service.cpp:346
Service::m_auditorRestart
Gaudi::Property< bool > m_auditorRestart
Definition: Service.h:221
IAuditor::ReStart
Definition: IAuditor.h:25
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
std::exception::what
T what(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:119
std::exception
STL class.
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
Service::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: Service.h:54
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:111
Gaudi::Guards::AuditorGuard
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
Service::restart
StatusCode restart() override
Definition: Service.cpp:272
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode Service::sysStart | ( |  | ) |
| override

Initialize Service.

Definition at line 72 of file Service.cpp.

73 {
74 StatusCode sc;
75
76 try {
77 m_targetState = Gaudi::StateMachine::ChangeState( Gaudi::StateMachine::START, m_state );
78 Gaudi::Guards::AuditorGuard guard( this,
79 // check if we want to audit the initialize
80 ( m_auditorStart ) ? auditorSvc().get() : nullptr, IAuditor::Start );
81 sc = start();
82 if ( sc.isSuccess() ) m_state = m_targetState;
83 return sc;
84 } catch ( const GaudiException& Exception ) {
85 fatal() << "in sysStart(): exception with tag=" << Exception.tag() << " is caught" << endmsg;
86 error() << Exception << endmsg;
87 // Stat stat( chronoSvc() , Exception.tag() );
88 } catch ( const std::exception& Exception ) {
89 fatal() << "in sysStart(): standard std::exception is caught" << endmsg;
90 fatal() << Exception.what() << endmsg;
91 // Stat stat( chronoSvc() , "*std::exception*" );
92 } catch ( ... ) {
93 fatal() << "in sysStart(): UNKNOWN Exception is caught" << endmsg;
94 // Stat stat( chronoSvc() , "*UNKNOWN Exception*" ) ;
95 }
96
97 return StatusCode::FAILURE;
98 }
IAuditor::Start
Definition: IAuditor.h:25
Service::m_targetState
Gaudi::StateMachine::State m_targetState
Service state.
Definition: Service.h:193
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
Service::m_state
Gaudi::StateMachine::State m_state
Service state.
Definition: Service.h:191
StatusCode::FAILURE
Definition: StatusCode.h:29
Service::auditorSvc
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Service.cpp:346
Service::start
StatusCode start() override
Definition: Service.cpp:137
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
std::exception::what
T what(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:119
std::exception
STL class.
Gaudi::StateMachine::ChangeState
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
Gaudi::StateMachine::START
Definition: StateMachine.h:26
Service::m_auditorStart
Gaudi::Property< bool > m_auditorStart
Definition: Service.h:217
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:111
Gaudi::Guards::AuditorGuard
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode Service::sysStop | ( |  | ) |
| override

Initialize Service.

Definition at line 101 of file Service.cpp.

102 {
103 StatusCode sc;
104
105 try {
106 m_targetState = Gaudi::StateMachine::ChangeState( Gaudi::StateMachine::STOP, m_state );
107 Gaudi::Guards::AuditorGuard guard( this,
108 // check if we want to audit the initialize
109 ( m_auditorStop ) ? auditorSvc().get() : nullptr, IAuditor::Stop );
110 sc = stop();
111 if ( sc.isSuccess() ) m_state = m_targetState;
112 return sc;
113 } catch ( const GaudiException& Exception ) {
114 fatal() << "in sysStop(): exception with tag=" << Exception.tag() << " is caught" << endmsg;
115 error() << Exception << endmsg;
116 // Stat stat( chronoSvc() , Exception.tag() );
117 } catch ( const std::exception& Exception ) {
118 fatal() << "in sysStop(): standard std::exception is caught" << endmsg;
119 error() << Exception.what() << endmsg;
120 // Stat stat( chronoSvc() , "*std::exception*" );
121 } catch ( ... ) {
122 fatal() << "in sysStop(): UNKNOWN Exception is caught" << endmsg;
123 // Stat stat( chronoSvc() , "*UNKNOWN Exception*" ) ;
124 }
125
126 return StatusCode::FAILURE;
127 }
Service::m_targetState
Gaudi::StateMachine::State m_targetState
Service state.
Definition: Service.h:193
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
Service::m_state
Gaudi::StateMachine::State m_state
Service state.
Definition: Service.h:191
StatusCode::FAILURE
Definition: StatusCode.h:29
IAuditor::Stop
Definition: IAuditor.h:25
Service::auditorSvc
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Service.cpp:346
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
std::exception::what
T what(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:119
Service::stop
StatusCode stop() override
Definition: Service.cpp:130
std::exception
STL class.
Gaudi::StateMachine::STOP
Definition: StateMachine.h:27
Gaudi::StateMachine::ChangeState
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
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:111
Gaudi::Guards::AuditorGuard
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way...
Definition: Guards.h:214
Service::m_auditorStop
Gaudi::Property< bool > m_auditorStop
Definition: Service.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

Gaudi::StateMachine::State Service::targetFSMState | ( |  | ) | const
| inline override

Definition at line 55 of file Service.h.

55 { return m_targetState; }
Service::m_targetState
Gaudi::StateMachine::State m_targetState
Service state.
Definition: Service.h:193

StatusCode Service::terminate | ( |  | ) |
| inline override

Definition at line 53 of file Service.h.

53 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:30

## Friends And Related Function Documentation

friend class ServiceManager
| friend

Definition at line 42 of file Service.h.

## Member Data Documentation

Gaudi::Property<bool> Service::m_auditInit {this, "AuditServices", false, "[[deprecated]] unused"}
| protected

Definition at line 215 of file Service.h.

Gaudi::Property<bool> Service::m_auditorFinalize {this, "AuditFinalize", false, "trigger auditor on finalize()"}
| protected

Definition at line 219 of file Service.h.

Gaudi::Property<bool> Service::m_auditorInitialize {this, "AuditInitialize", false, "trigger auditor on initialize()"}
| protected

Definition at line 216 of file Service.h.

Gaudi::Property<bool> Service::m_auditorReinitialize {this, "AuditReinitialize", false, "trigger auditor on reinitialize()"}
| protected

Definition at line 220 of file Service.h.

Gaudi::Property<bool> Service::m_auditorRestart {this, "AuditRestart", false, "trigger auditor on restart()"}
| protected

Definition at line 221 of file Service.h.

Gaudi::Property<bool> Service::m_auditorStart {this, "AuditStart", false, "trigger auditor on start()"}
| protected

Definition at line 217 of file Service.h.

Gaudi::Property<bool> Service::m_auditorStop {this, "AuditStop", false, "trigger auditor on stop()"}
| protected

Definition at line 218 of file Service.h.

std::once_flag Service::m_initFlag
| private

Definition at line 201 of file Service.h.

StatusCode Service::m_initSC
| private

Definition at line 200 of file Service.h.

std::string Service::m_name
| private

Service Name.

Definition at line 204 of file Service.h.

Gaudi::Property<int> Service::m_outputLevel {this, "OutputLevel", MSG::NIL, "output level"}
| protected

Definition at line 214 of file Service.h.

SmartIF<IAuditorSvc> Service::m_pAuditorSvc
| mutable protected

Auditor Service.

Definition at line 224 of file Service.h.

Gaudi::StateMachine::State Service::m_state = Gaudi::StateMachine::OFFLINE
| protected

Service state.

Definition at line 191 of file Service.h.

SmartIF<ISvcLocator> Service::m_svcLocator
| mutable private

Service Locator reference.

Definition at line 206 of file Service.h.

SmartIF<ISvcManager> Service::m_svcManager
| private

Definition at line 207 of file Service.h.

Gaudi::StateMachine::State Service::m_targetState = Gaudi::StateMachine::OFFLINE
| protected

Service state.

Definition at line 193 of file Service.h.

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

- GaudiKernel/GaudiKernel/Service.h
- GaudiKernel/src/Lib/Service.cpp