The Gaudi Framework  v40r0 (475e45c1)
Gaudi::BootSvcLocator Class Reference
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. More...
 
- Public Member Functions inherited from implements< ISvcLocator >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 implements ()=default
 Default constructor. More...
 
 implements (const implements &)
 Copy constructor (zero the reference count) More...
 
implementsoperator= (const implements &)
 Assignment operator (do not touch the reference count). More...
 
unsigned long addRef () const override
 Reference Interface instance
More...
 
unsigned long release () const override
 Release Interface instance
More...
 
unsigned long refCount () const override
 Current reference count
More...
 

Additional Inherited Members

- Public Types inherited from implements< ISvcLocator >
using base_class = implements< Interfaces... >
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces... >
 Typedef to the base of this class. More...
 
using iids = typename extend_interfaces_base::ext_iids
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
 take union of the ext_iids of all Interfaces... More...
 
- 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
More...
 

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 }

◆ 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 }

◆ 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 }

The documentation for this class was generated from the following file:
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
GaudiDict::typeName
std::string typeName(const std::type_info &typ)
Definition: Dictionary.cpp:31