54 typedef std::map<std::string, std::string, std::less<>>
MapType;
66 const std::list<IService*>&
getServices()
const override;
114 const std::string&
name()
const override {
115 static std::string _name =
"ServiceManager";
123 template <
typename T>
133 auto lck = std::scoped_lock{
m_gLock };
136 ListSvc::const_iterator
find( std::string_view
name )
const {
137 auto lck = std::scoped_lock{
m_gLock };
141 auto lck = std::scoped_lock{
m_gLock };
145 auto lck = std::scoped_lock{
m_gLock };
177 mutable std::map<std::string, std::recursive_mutex>
m_lockMap;
SmartIF< ISvcLocator > m_svcLocator
Service locator (needed to access the MessageSvc)
Helper class to parse a string of format "type/name".
Extension of the STL map.
Definition of the basic interface.
The IMessage is the interface implemented by the message service.
General service interface definition.
StatusCode declareSvcType(std::string svcname, std::string svctype) override
implementation of ISvcManager::declareSvcType
ListSvc::const_iterator find(const IService *ptr) const
const std::list< IService * > & getServices() const override
Return the list of Services.
ListSvc::iterator find(const IService *ptr)
const std::string & name() const override
Return the name of the manager (implementation of INamedInterface)
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).
StatusCode reinitialize() override
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY) override
implementation of ISvcManager::addService
StatusCode finalize() override
Finalize (from INITIALIZED to CONFIGURED).
bool existsService(std::string_view name) const override
implementation of ISvcLocation::existsService
std::list< IService * > m_listOfPtrs
List of pointers to the know services used to implement getServices()
std::map< std::string, std::string, std::less<> > MapType
StatusCode removeService(IService *svc) override
implementation of ISvcManager::removeService
StatusCode initialize() override
Initialization (from CONFIGURED to INITIALIZED).
StatusCode restart() override
Initialization (from RUNNING to RUNNING, via INITIALIZED).
SmartIF< IService > & createService(const Gaudi::Utils::TypeNameString &nametype) override
implementation of ISvcManager::createService NOTE: as this returns a &, we must guarantee that once c...
SmartIF< IService > m_appSvc
Pointer to the application IService interface.
GaudiUtils::Map< InterfaceID, SmartIF< IInterface > > m_defaultImplementations
SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true) override
Returns a smart pointer to a service.
SmartIF< ISvcLocator > & serviceLocator() const override
Function needed by CommonMessaging.
~ServiceManager() override
virtual destructor
std::map< std::string, std::recursive_mutex > m_lockMap
ListSvc m_listsvc
List of service maintained by ServiceManager This contains SmartIF<T> for all services – and because ...
ServiceManager(IInterface *application)
default creator
ListSvc::iterator find(std::string_view name)
void setLoopCheckEnabled(bool en) override
Set the value of the initialization loop check flag.
std::list< ServiceItem > ListSvc
bool m_loopCheck
Check for service initialization loops.
int getPriority(std::string_view name) const override
manage priorities of services
std::recursive_mutex m_gLock
Mutex to synchronize shared service initialization between threads.
StatusCode stop() override
Stop (from RUNNING to INITIALIZED).
StatusCode setPriority(std::string_view name, int pri) override
SmartIF< T > service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)
Returns a smart pointer to the requested interface of a service.
MapType m_maptype
Map of service name and service type.
Small smart pointer class with automatic reference counting for IInterface.
This class is used for returning status codes from appropriate routines.
Base class used to extend a class implementing other interfaces.
ServiceItem(IService *s, int p=0, bool act=false)
bool operator<(const ServiceItem &rhs) const
SmartIF< IService > service
bool operator==(std::string_view name) const
bool operator==(const IService *ptr) const