The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
Gaudi::BootSvcLocator Class Reference

A dual-stage boostrap mechanism is used to ensure an orderly startup of the ApplicationMgr. More...

Inheritance diagram for Gaudi::BootSvcLocator:
Collaboration diagram for Gaudi::BootSvcLocator:

Public Member Functions

const std::list< IService * > & getServices () const override
 
bool existsService (std::string_view name) const override
 
SmartIF< IService > & service (const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true) override
 Returns a smart pointer to a service.
 
- Public Member Functions inherited from implements< ISvcLocator >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 
 implements ()=default
 Default constructor.
 
 implements (const implements &)
 Copy constructor (zero the reference count)
 
implementsoperator= (const implements &)
 Assignment operator (do not touch the reference count).
 
unsigned long addRef () const override
 Reference Interface instance.
 
unsigned long release () const override
 Release Interface instance.
 
unsigned long refCount () const override
 Current reference count.
 

Additional Inherited Members

- Public Types inherited from implements< ISvcLocator >
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
using iids
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids
 take union of the ext_iids of all Interfaces...
 
- Protected Member Functions inherited from implements< ISvcLocator >
unsigned long decRef () const override
 
- Protected Attributes inherited from implements< ISvcLocator >
std::atomic_ulong m_refCount
 Reference counter.
 

Detailed Description

A dual-stage boostrap mechanism is used to ensure an orderly startup of the ApplicationMgr.

If this function is called before the singleton ApplicationMgr instance exists, a BootstrapAppMgr singleton instance is created. This responds to any subsequent requests for services by returning StatusCode::FAILURE, unless the ApplicationMgr singleton instance has been created in the interim. In this case, the BootstrapAppMgr forwards the request to the ApplicationMgr instance. The motivation for this is to handle static object instances where the constructor attempts to locate services and would otherwise instantiate the ApplicationMgr instance in an unorderly manner. This logic requires that the ApplicationMgr instance is created explicitly.

Definition at line 50 of file Bootstrap.cpp.

Member Function Documentation

◆ existsService()

bool Gaudi::BootSvcLocator::existsService ( std::string_view name) const
override

Definition at line 192 of file Bootstrap.cpp.

192 {
193 return s_appmgrInstance && s_svclocInstance->existsService( name );
194}
virtual bool existsService(std::string_view name) const =0
Check the existence of a service given a service name.

◆ getServices()

const std::list< IService * > & Gaudi::BootSvcLocator::getServices ( ) const
override

Definition at line 189 of file Bootstrap.cpp.

189 {
190 return s_appmgrInstance ? s_svclocInstance->getServices() : s_bootServices;
191}
virtual const std::list< IService * > & getServices() const =0
Return the list of Services.

◆ service()

SmartIF< IService > & Gaudi::BootSvcLocator::service ( const Gaudi::Utils::TypeNameString & typeName,
const bool createIf = true )
override

Returns a smart pointer to a service.

Definition at line 196 of file Bootstrap.cpp.

196 {
197 return s_appmgrInstance ? s_svclocInstance->service( typeName, createIf ) : s_bootService;
198}
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.

The documentation for this class was generated from the following file: