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