Go to the documentation of this file.
11 #ifndef GAUDIKERNEL_SERVICE_H
12 #define GAUDIKERNEL_SERVICE_H
88 [[deprecated(
"use service<T>(name, createIf) -> SmartIF<T>" )]]
StatusCode
96 const_cast<T*
>( psvc )->addRef();
105 [[deprecated(
"use service<T>(name, createIf) -> SmartIF<T>" )]]
StatusCode
107 auto ptr = service<T>(
name, createIf );
108 psvc = ( ptr ? ptr.get() :
nullptr );
116 template <
typename IFace = IService>
126 [[deprecated(
"use service<T>(name, createIf) -> SmartIF<T>" )]]
StatusCode
128 return service( svcType +
"/" + svcName, psvc );
139 this->declareTool( hndl, hndl.
typeAndName() ).ignore();
145 return this->declareTool( handle, handle.
typeAndName(), createIf );
161 " tool " + toolTypeAndName,
165 m_toolHandles.push_back( &handle );
174 addToolsArray( hndlArr );
180 m_toolHandleArrays.push_back( &hndlArr );
190 void initToolHandles()
const;
211 void sysInitialize_imp();
221 void setServiceManager(
ISvcManager* ism )
override;
227 mutable bool m_toolHandlesInit =
false;
238 Gaudi::Property<bool> m_auditorReinitialize{
this,
"AuditReinitialize",
false,
"trigger auditor on reinitialize()" };
242 "retrieve all AlgTools during initialize" };
244 "check data dependencies of AlgTools (error if any found)" };
250 #endif // GAUDIKERNEL_SERVICE_H
SmartIF< IService > service(std::string_view name, const bool quiet=false, const bool createIf=true) const
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service
Gaudi::StateMachine::State targetFSMState() const override
std::vector< GaudiHandleArrayBase * > m_toolHandleArrays
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
void addToolsArray(ToolHandleArray< T > &hndlArr)
SmartIF< ISvcLocator > m_svcLocator
Service Locator reference
SmartIF< IFace > service(const std::string &name, bool createIf=true) const
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
Helper class to implement the IProperty interface.
StatusCode reinitialize() override
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
Gaudi::StateMachine::State FSMState() const override
std::string m_name
Service Name
std::once_flag m_initFlag
State
Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm,...
StatusCode initialize() override
Initialization (from CONFIGURED to INITIALIZED).
std::vector< IAlgTool * > m_tools
StatusCode configure() override
SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true) override
Returns a smart pointer to a service.
an helper to share the implementation of service() among the various kernel base classes
StatusCode finalize() override
Finalize (from INITIALIZED to CONFIGURED).
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.
StatusCode declareTool(ToolHandle< T > &handle, const std::string &toolTypeAndName, bool createIf=true)
Declare used tool.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Details::PropertyBase &prop)
Declare a property.
constexpr static const auto SUCCESS
TYPE * get() const
Get interface pointer.
int outputLevel() const
get the Service's output level
SmartIF< ISvcManager > m_svcManager
Gaudi::PluginService::Factory< IService *(const std::string &, ISvcLocator *)> Factory
StatusCode restart() override
Initialization (from RUNNING to RUNNING, via INITIALIZED).
SmartIF< ISvcLocator > & serviceLocator() const override
Function needed by CommonMessaging.
StatusCode service(const std::string &name, T *&psvc, bool createIf=true) const
StatusCode declareTool(ToolHandle< T > &handle, bool createIf=true)
constexpr static const auto FAILURE
StatusCode stop() override
Stop (from RUNNING to INITIALIZED).
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.
std::vector< BaseToolHandle * > m_toolHandles
StatusCode terminate() override