1 #ifndef GAUDIKERNEL_SERVICE_H
2 #define GAUDIKERNEL_SERVICE_H
6 #include "GaudiKernel/IService.h"
7 #include "GaudiKernel/ISvcLocator.h"
8 #include "GaudiKernel/ServiceLocatorHelper.h"
9 #include "GaudiKernel/IProperty.h"
10 #include "GaudiKernel/IStateful.h"
11 #include "GaudiKernel/PropertyMgr.h"
12 #include "GaudiKernel/Property.h"
13 #include "GaudiKernel/IAuditorSvc.h"
14 #include "GaudiKernel/CommonMessaging.h"
15 #include "GaudiKernel/SmartIF.h"
16 #include <Gaudi/PluginService.h>
36 typedef Gaudi::PluginService::Factory<
IService*,
44 virtual unsigned long release();
47 virtual const std::string&
name()
const;
81 virtual const std::vector<Property*>& getProperties( )
const;
123 template <
class TYPE>
125 (
const std::string&
name ,
149 const_cast<T*
>(psvc)->
addRef();
158 StatusCode service(
const std::string& name, T*& psvc,
bool createIf =
true )
const {
178 return service(svcType +
"/" + svcName, psvc);
211 (
const std::string& name ,
213 const std::string& doc =
"none" )
const
215 return m_propertyMgr -> declareProperty ( name , property , doc ) ;
227 (
const std::string& name ,
229 const std::string& rname =
"" )
const
231 return m_propertyMgr -> declareRemoteProperty ( name , rsvc , rname ) ;
250 int outputLevel()
const {
return m_outputLevel.value(); }
266 bool m_auditorInitialize;
269 bool m_auditorFinalize;
270 bool m_auditorReinitialize;
271 bool m_auditorRestart;
274 void initOutputLevel(
Property& prop);
277 #ifndef GAUDI_NEW_PLUGIN_SERVICE
282 template <
typename S,
typename... Args>
283 static typename S::ReturnType
create(Args...
args) {
284 return new T(
args...);
290 #define DECLARE_SERVICE_FACTORY(x) \
291 DECLARE_FACTORY_WITH_CREATOR(x, SvcFactory< x >, Service::Factory)
292 #define DECLARE_NAMED_SERVICE_FACTORY(x, n) \
293 DECLARE_FACTORY_WITH_CREATOR_AND_ID(x, SvcFactory< x >, #n, Service::Factory)
294 #define DECLARE_NAMESPACE_SERVICE_FACTORY(n, x) \
295 DECLARE_SERVICE_FACTORY(n::x)
300 #define DECLARE_SERVICE_FACTORY(x) DECLARE_COMPONENT(x)
301 #define DECLARE_NAMED_SERVICE_FACTORY(x, n) DECLARE_COMPONENT_WITH_ID(x, #n)
302 #define DECLARE_NAMESPACE_SERVICE_FACTORY(n, x) DECLARE_COMPONENT(n::x)
306 #endif // GAUDIKERNEL_SERVICE_H