2 #ifndef GAUDISVC_ServiceManager_H
3 #define GAUDISVC_ServiceManager_H
6 #include "GaudiKernel/Kernel.h"
7 #include "GaudiKernel/ISvcManager.h"
8 #include "GaudiKernel/ISvcLocator.h"
9 #include "GaudiKernel/IStateful.h"
10 #include "GaudiKernel/SmartIF.h"
11 #include "GaudiKernel/ComponentManager.h"
12 #include "GaudiKernel/Map.h"
17 #include "boost/thread.hpp"
49 return service.
get() == ptr;
72 virtual const std::list<IService*>&
getServices()
const;
116 const std::string &
name()
const {
117 static std::string _name =
"ServiceManager";
124 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
131 inline ListSvc::iterator
find(
const std::string &
name) {
134 inline ListSvc::const_iterator
find(
const std::string &
name)
const {
164 #endif // GAUDISVC_ServiceManager_H
ListSvc::const_iterator find(const IService *ptr) const
The ServiceManager class is in charge of the creation of concrete instances of Services.
virtual StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY)=0
Add a service to the "active" list of services of the factory.
std::list< IService * > m_listOfPtrs
List of pointers to the know services used to implement getServices()
static const int DEFAULT_SVC_PRIORITY
SmartIF< IService > m_appSvc
Pointer to the application IService interface.
virtual StatusCode stop()
Stop (from RUNNING to INITIALIZED).
ListSvc::iterator find(const IService *ptr)
GaudiUtils::Map< InterfaceID, SmartIF< IInterface > > m_defaultImplementations
const std::string & name() const
Return the name of the manager (implementation of INamedInterface)
bool m_loopCheck
Check for service initialization loops.
virtual int getPriority(const std::string &name) const
manage priorities of services
ServiceManager(IInterface *application)
default creator
virtual const std::list< IService * > & getServices() const
Return the list of Services.
virtual StatusCode reinitialize()
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
Base class used to extend a class implementing other interfaces.
SmartIF< ISvcLocator > & serviceLocator() const
Function needed by CommonMessaging.
MapType m_maptype
Map of service name and service type.
virtual const std::string & name() const =0
Retrieve the name of the instance.
TYPE * get() const
Get interface pointer.
Helper class to parse a string of format "type/name".
virtual SmartIF< IService > & createService(const Gaudi::Utils::TypeNameString &nametype)
implementation of ISvcManager::createService
General service interface definition.
virtual StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY)
implementation of ISvcManager::addService
This class is used for returning status codes from appropriate routines.
virtual SmartIF< IService > & createService(const Gaudi::Utils::TypeNameString &nametype)=0
Creates and instance of a service type that has been declared beforehand and assigns it a name...
Definition of the basic interface.
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
virtual StatusCode setPriority(const std::string &name, int pri)
virtual void setLoopCheckEnabled(bool en)
Set the value of the initialization loop check flag.
The IMessage is the interface implemented by the message service.
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
bool operator==(const std::string &name) const
virtual bool existsService(const std::string &name) const
implementation of ISvcLocation::existsService
virtual StatusCode declareSvcType(const std::string &svcname, const std::string &svctype)
implementation of ISvcManager::declareSvcType
Property base class allowing Property* collections to be "homogeneous".
virtual StatusCode removeService(IService *svc)
implementation of ISvcManager::removeService
virtual ~ServiceManager()
virtual destructor
GaudiUtils::Map< std::string, std::string > MapType
ListSvc::const_iterator find(const std::string &name) const
bool operator<(const ServiceItem &rhs) const
ListSvc::iterator find(const std::string &name)
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)
Returns a smart pointer to a service.
virtual bool loopCheckEnabled() const
Get the value of the initialization loop check flag.
boost::recursive_mutex m_svcinitmutex
Mutex to synchronize shared service initialization between threads.
virtual StatusCode restart()
Initialization (from RUNNING to RUNNING, via INITIALIZED).
std::string typeName(const std::type_info &typ)
std::list< ServiceItem > ListSvc
ListSvc m_listsvc
List of service maintained by ServiceManager.
ServiceItem(IService *s, long p=0, bool act=false)
bool operator==(const IService *ptr) const
SmartIF< IService > service
virtual StatusCode start()
Start (from INITIALIZED to RUNNING).
SmartIF< ISvcLocator > m_svcLocator
Service locator (needed to access the MessageSvc)