1 #ifndef GAUDIKERNEL_SERVICE_H 2 #define GAUDIKERNEL_SERVICE_H 39 using Factory = Gaudi::PluginService::Factory<IService*( const std::string&, ISvcLocator* )>;
92 const_cast<T*
>( psvc )->addRef();
103 auto ptr = service<T>(
name, createIf );
104 psvc = ( ptr ? ptr.get() : nullptr );
112 template <
typename IFace = IService>
125 return service( svcType +
"/" + svcName, psvc );
142 " tool " + toolTypeAndName,
167 void sysInitialize_imp();
177 void setServiceManager(
ISvcManager* ism )
override;
195 #endif // GAUDIKERNEL_SERVICE_H The ServiceManager class is in charge of the creation of concrete instances of Services.
constexpr static const auto FAILURE
an helper to share the implementation of service() among the various kernel base classes ...
Define general base for Gaudi exception.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
StatusCode finalize() override
Finalize (from INITIALIZED to CONFIGURED).
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
Implementation of property with value of concrete type.
The ISvcManager is the interface implemented by the Service Factory in the Application Manager to sup...
SmartIF< ISvcLocator > & serviceLocator() const override
Function needed by CommonMessaging.
int outputLevel() const
get the Service's output level
SmartIF< ISvcLocator > m_svcLocator
Service Locator reference.
StatusCode restart() override
Initialization (from RUNNING to RUNNING, via INITIALIZED).
std::string m_name
Service Name.
State
Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm, Service, AlgTool).
StatusCode configure() override
TYPE * get() const
Get interface pointer.
StatusCode stop() override
Stop (from RUNNING to INITIALIZED).
This class is used for returning status codes from appropriate routines.
The IMessage is the interface implemented by the message service.
std::once_flag m_initFlag
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.
constexpr static const auto SUCCESS
SmartIF< IFace > service(const std::string &name, bool createIf=true) const
Gaudi::PluginService::Factory< IService *(const std::string &, ISvcLocator *)> Factory
StatusCode declareTool(ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
Declare used tool.
StatusCode reinitialize() override
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
Helper class to implement the IProperty interface.
StatusCode terminate() override
Gaudi::StateMachine::State FSMState() const override
Gaudi::StateMachine::State targetFSMState() const override
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.
SmartIF< IService > service(const std::string &name, const bool quiet=false, const bool createIf=true) const
SmartIF< ISvcManager > m_svcManager
SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true) override
Returns a smart pointer to a service.
Base class for all services.
StatusCode service(const std::string &name, T *&psvc, bool createIf=true) const
StatusCode initialize() override
Initialization (from CONFIGURED to INITIALIZED).