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 );
146 debug() <<
"Handle for private tool" << toolTypeAndName <<
" successfully created and stored." <<
endmsg;
149 error() <<
"Handle for private tool" << toolTypeAndName <<
" could not be created." <<
endmsg;
172 debug() <<
"Handle for public tool" << toolTypeAndName <<
" successfully created and stored." <<
endmsg;
175 error() <<
"Handle for public tool" << toolTypeAndName <<
" could not be created." <<
endmsg;
199 void sysInitialize_imp();
209 void setServiceManager(
ISvcManager* ism )
override;
227 #ifndef GAUDI_NEW_PLUGIN_SERVICE 233 template <
typename S,
typename... Args>
236 return new T( std::forward<Args>(
args )... );
242 #define DECLARE_SERVICE_FACTORY( x ) DECLARE_FACTORY_WITH_CREATOR( x, SvcFactory<x>, Service::Factory ) 243 #define DECLARE_NAMED_SERVICE_FACTORY( x, n ) \ 244 DECLARE_FACTORY_WITH_CREATOR_AND_ID( x, SvcFactory<x>, #n, Service::Factory ) 245 #define DECLARE_NAMESPACE_SERVICE_FACTORY( n, x ) DECLARE_SERVICE_FACTORY( n::x ) 250 #define DECLARE_SERVICE_FACTORY( x ) DECLARE_COMPONENT( x ) 251 #define DECLARE_NAMED_SERVICE_FACTORY( x, n ) DECLARE_COMPONENT_WITH_ID( x, #n ) 252 #define DECLARE_NAMESPACE_SERVICE_FACTORY( n, x ) DECLARE_COMPONENT( n::x ) 256 #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 ...
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.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
The ISvcManager is the interface implemented by the Service Factory in the Application Manager to sup...
bool isSuccess() const
Test for a status code of SUCCESS.
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.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
StatusCode stop() override
Stop (from RUNNING to INITIALIZED).
This class is used for returning status codes from appropriate routines.
StatusCode declarePrivateTool(ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
Declare used Private tool.
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
StatusCode declarePublicTool(ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
Declare used Public tool.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Class wrapping the signature for a factory with any number of arguments.
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.
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > Factory
StatusCode service(const std::string &name, T *&psvc, bool createIf=true) const
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
StatusCode initialize() override
Initialization (from CONFIGURED to INITIALIZED).