1 #ifndef GAUDIKERNEL_SERVICE_H 2 #define GAUDIKERNEL_SERVICE_H 93 const_cast<T*
>( psvc )->addRef();
104 auto ptr = service<T>(
name, createIf );
105 psvc = ( ptr ? ptr.get() : nullptr );
113 template <
typename IFace = IService>
126 return service( svcType +
"/" + svcName, psvc );
143 " tool " + toolTypeAndName,
168 void sysInitialize_imp();
178 void setServiceManager(
ISvcManager* ism )
override;
196 #ifndef GAUDI_NEW_PLUGIN_SERVICE 202 template <
typename S,
typename... Args>
205 return new T( std::forward<Args>(
args )... );
211 #define DECLARE_SERVICE_FACTORY( x ) DECLARE_FACTORY_WITH_CREATOR( x, SvcFactory<x>, Service::Factory ) 212 #define DECLARE_NAMED_SERVICE_FACTORY( x, n ) \ 213 DECLARE_FACTORY_WITH_CREATOR_AND_ID( x, SvcFactory<x>, #n, Service::Factory ) 214 #define DECLARE_NAMESPACE_SERVICE_FACTORY( n, x ) DECLARE_SERVICE_FACTORY( n::x ) 219 #define DECLARE_SERVICE_FACTORY( x ) DECLARE_COMPONENT( x ) 220 #define DECLARE_NAMED_SERVICE_FACTORY( x, n ) DECLARE_COMPONENT_WITH_ID( x, #n ) 221 #define DECLARE_NAMESPACE_SERVICE_FACTORY( n, x ) DECLARE_COMPONENT( n::x ) 225 #endif // GAUDIKERNEL_SERVICE_H The ServiceManager class is in charge of the creation of concrete instances of Services.
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.
static S::ReturnType create(Args &&...args)
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.
SmartIF< IFace > service(const std::string &name, bool createIf=true) const
Class wrapping the signature for a factory with any number of arguments.
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.
Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > Factory
StatusCode service(const std::string &name, T *&psvc, bool createIf=true) const
StatusCode initialize() override
Initialization (from CONFIGURED to INITIALIZED).