2 #ifndef GAUDISVC_ServiceManager_H
3 #define GAUDISVC_ServiceManager_H
17 #include "boost/thread.hpp"
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()
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)
SmartIF< ISvcLocator > m_svcLocator
Service locator (needed to access the MessageSvc)
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.
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.
TYPE * get() const
Get interface pointer.
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
bool operator==(const std::string &name) const
static const int DEFAULT_SVC_PRIORITY
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).