1 #ifndef GAUDIKERNEL_SERVICE_H
2 #define GAUDIKERNEL_SERVICE_H
42 virtual unsigned long release();
45 virtual const std::string&
name()
const;
79 virtual const std::vector<Property*>& getProperties( )
const;
121 template <
class TYPE>
147 const_cast<T*
>(psvc)->
addRef();
176 return service(svcType +
"/" + svcName, psvc);
209 (
const std::string& name ,
211 const std::string& doc =
"none" )
const
213 return m_propertyMgr -> declareProperty ( name , property , doc ) ;
225 (
const std::string& name ,
227 const std::string& rname =
"" )
const
229 return m_propertyMgr -> declareRemoteProperty ( name , rsvc , rname ) ;
272 void initOutputLevel(
Property& prop);
275 #ifndef GAUDI_NEW_PLUGIN_SERVICE
279 template <
typename S>
280 static typename S::ReturnType
create(
typename S::Arg1Type a1,
281 typename S::Arg2Type a2) {
282 return new T(a1, a2);
287 #define DECLARE_SERVICE_FACTORY(x) \
288 DECLARE_FACTORY_WITH_CREATOR(x, SvcFactory< x >, Service::Factory)
289 #define DECLARE_NAMED_SERVICE_FACTORY(x, n) \
290 DECLARE_FACTORY_WITH_CREATOR_AND_ID(x, SvcFactory< x >, #n, Service::Factory)
291 #define DECLARE_NAMESPACE_SERVICE_FACTORY(n, x) \
292 DECLARE_SERVICE_FACTORY(n::x)
297 #define DECLARE_SERVICE_FACTORY(x) DECLARE_COMPONENT(x)
298 #define DECLARE_NAMED_SERVICE_FACTORY(x, n) DECLARE_COMPONENT_WITH_ID(x, #n)
299 #define DECLARE_NAMESPACE_SERVICE_FACTORY(n, x) DECLARE_COMPONENT(n::x)
303 #endif // GAUDIKERNEL_SERVICE_H
The ServiceManager class is in charge of the creation of concrete instances of Services.
virtual StatusCode configure()
Configuration (from OFFLINE to CONFIGURED).
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
BooleanProperty m_auditInit
Gaudi::StateMachine::State m_targetState
Service state.
an helper to share the implementation of service() among the various kernel base classes $Id: ...
IntegerProperty m_outputLevel
Service output level.
virtual StatusCode stop()
Stop (from RUNNING to INITIALIZED).
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
const std::string & name() const
Return the name of the manager (implementation of INamedInterface)
Gaudi::StateMachine::State m_state
Service state.
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
virtual SmartIF< ISvcLocator > & serviceLocator() const =0
Needed to locate the message service.
The ISvcManager is the interface implemented by the Service Factory in the Application Manager to sup...
int outputLevel() const
get the Service's output level
SmartIF< ISvcLocator > m_svcLocator
Service Locator reference.
virtual StatusCode reinitialize()
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
std::string m_name
Service Name.
State
Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm, Service, AlgTool).
GAUDI_API Property * getProperty(const IProperty *p, const std::string &name)
simple function which gets the property with given name from the component
Property manager helper class.
bool isValid() const
Allow for check if smart pointer is valid.
General service interface definition.
This class is used for returning status codes from appropriate routines.
The IMessage is the interface implemented by the message service.
static S::ReturnType create(typename S::Arg1Type a1, typename S::Arg2Type a2)
TYPE * get() const
Get interface pointer.
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
bool m_auditorReinitialize
virtual StatusCode terminate()
Initialization (from CONFIGURED to OFFLINE).
virtual Gaudi::StateMachine::State FSMState() const
Get the current state.
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.
PropertyMgr * m_propertyMgr
Property Manager.
Property base class allowing Property* collections to be "homogeneous".
virtual unsigned long release()=0
Release Interface instance.
Class wrapping the signature for a factory with 2 arguments.
virtual const std::string & name() const =0
This is needed to avoid ambiguous calls to name()
Templated class to add the standard messaging functionalities.
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
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.
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)
Returns a smart pointer to a service.
SmartIF< ISvcManager > m_svcManager
virtual Gaudi::StateMachine::State targetFSMState() const
When we are in the middle of a transition, get the state where the transition is leading us...
virtual StatusCode restart()
Initialization (from RUNNING to RUNNING, via INITIALIZED).
The IProperty is the basic interface for all components which have properties that can be set or get...
Base class for all services.
Gaudi::PluginService::Factory2< IService *, const std::string &, ISvcLocator * > Factory
StatusCode service(const std::string &name, T *&psvc, bool createIf=true) const