1 #ifndef GAUDISVC_ServiceManager_H 2 #define GAUDISVC_ServiceManager_H 13 #include "boost/thread.hpp" 121 template <
typename T>
127 #if !defined( GAUDI_V22_API ) || defined( G22_NEW_SVCLOCATOR ) 138 boost::lock_guard<boost::recursive_mutex> lck(
m_gLock );
143 boost::lock_guard<boost::recursive_mutex> lck(
m_gLock );
148 boost::lock_guard<boost::recursive_mutex> lck(
m_gLock );
153 boost::lock_guard<boost::recursive_mutex> lck(
m_gLock );
193 #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()
void setLoopCheckEnabled(bool en) override
Set the value of the initialization loop check flag.
SmartIF< IService > m_appSvc
Pointer to the application IService interface.
boost::lock_guard< Mutex_t > LockGuard_t
ListSvc::iterator find(const IService *ptr)
GaudiUtils::Map< InterfaceID, SmartIF< IInterface > > m_defaultImplementations
StatusCode finalize() override
Finalize (from INITIALIZED to CONFIGURED).
SmartIF< ISvcLocator > m_svcLocator
Service locator (needed to access the MessageSvc)
bool m_loopCheck
Check for service initialization loops.
SmartIF< ISvcLocator > & serviceLocator() const override
Function needed by CommonMessaging.
ServiceManager(IInterface *application)
default creator
boost::recursive_mutex Mutex_t
Mutex to synchronize shared service initialization between threads.
StatusCode restart() override
Initialization (from RUNNING to RUNNING, via INITIALIZED).
MapType m_maptype
Map of service name and service type.
TYPE * get() const
Get interface pointer.
bool existsService(const std::string &name) const override
implementation of ISvcLocation::existsService
StatusCode stop() override
Stop (from RUNNING to INITIALIZED).
Helper class to parse a string of format "type/name".
bool loopCheckEnabled() const override
Get the value of the initialization loop check flag.
General service interface definition.
SmartIF< T > service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)
Returns a smart pointer to the requested interface of a service.
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.
~ServiceManager() override
virtual destructor
const std::string & name() const override
Return the name of the manager (implementation of INamedInterface)
The IMessage is the interface implemented by the message service.
const std::list< IService * > & getServices() const override
Return the list of Services.
StatusCode start() override
Start (from INITIALIZED to RUNNING).
bool operator==(const std::string &name) const
int getPriority(const std::string &name) const override
manage priorities of services
void outputLevelUpdate() override
Function to call to update the outputLevel of the components (after a change in MessageSvc).
Base class used to extend a class implementing other interfaces.
StatusCode reinitialize() override
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
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)
StatusCode declareSvcType(const std::string &svcname, const std::string &svctype) override
implementation of ISvcManager::declareSvcType
StatusCode setPriority(const std::string &name, int pri) override
StatusCode removeService(IService *svc) override
implementation of ISvcManager::removeService
std::string typeName(const std::type_info &typ)
std::list< ServiceItem > ListSvc
ListSvc m_listsvc
List of service maintained by ServiceManager This contains SmartIF<T> for all services – and because...
SmartIF< IService > & createService(const Gaudi::Utils::TypeNameString &nametype) override
implementation of ISvcManager::createService NOTE: as this returns a &, we must guarantee that once c...
ServiceItem(IService *s, long p=0, bool act=false)
bool operator==(const IService *ptr) const
SmartIF< IService > service
std::map< std::string, Mutex_t > m_lockMap
StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY) override
implementation of ISvcManager::addService
StatusCode initialize() override
Initialization (from CONFIGURED to INITIALIZED).