|
Gaudi Framework, version v21r4 |
| Home | Generated: 7 Sep 2009 |


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 motiviation 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 37 of file Bootstrap.cpp.
Public Member Functions | |
| BootSvcLocator () | |
| virtual | ~BootSvcLocator () |
| virtual StatusCode | getService (const Gaudi::Utils::TypeNameString &typeName, const InterfaceID &iid, IInterface *&pinterface) |
| Get a specific interface pointer given a service name and interface id. | |
| virtual StatusCode | getService (const Gaudi::Utils::TypeNameString &typeName, IService *&svc, const bool createIf=true) |
| Get a reference to the service given a service name. | |
| virtual const std::list < IService * > & | getServices () const |
| Get a reference to a service and create it if it does not exists. | |
| virtual bool | existsService (const std::string &name) const |
| Check the existence of a service given a service name. | |
| virtual SmartIF< IService > & | service (const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true) |
| Returns a smart pointer to a service. | |
| BootSvcLocator::BootSvcLocator | ( | ) |
| BootSvcLocator::~BootSvcLocator | ( | ) | [virtual] |
| StatusCode Gaudi::BootSvcLocator::getService | ( | const Gaudi::Utils::TypeNameString & | typeName, | |
| const InterfaceID & | iid, | |||
| IInterface *& | pinterface | |||
| ) | [virtual] |
Get a specific interface pointer given a service name and interface id.
| name | Service name | |
| iid | Interface ID | |
| pinterface | Returned pointer to the requested interface |
Reimplemented from ISvcLocator.
Definition at line 249 of file Bootstrap.cpp.
00251 { 00252 StatusCode sc = StatusCode::FAILURE; 00253 if ( s_appmgrInstance.isValid() ) { 00254 sc = s_svclocInstance->getService(typeName, iid, pinterface ); 00255 } else { 00256 pinterface = s_bootInterface.get(); 00257 } 00258 return sc; 00259 }
| StatusCode Gaudi::BootSvcLocator::getService | ( | const Gaudi::Utils::TypeNameString & | typeName, | |
| IService *& | svc, | |||
| const bool | createIf = true | |||
| ) | [virtual] |
Get a reference to the service given a service name.
| name | Service name | |
| svc | Returned service pointer |
Reimplemented from ISvcLocator.
Definition at line 260 of file Bootstrap.cpp.
00262 { 00263 StatusCode sc = StatusCode::FAILURE; 00264 if ( s_appmgrInstance.isValid() ) { 00265 sc = s_svclocInstance->getService(typeName, svc, createIf ); 00266 } else { 00267 svc = s_bootService.get(); 00268 } 00269 return sc; 00270 }
Get a reference to a service and create it if it does not exists.
| name | Service name | |
| svc | Returned service pointer | |
| createIf | flag to control the creation Return the list of Services |
Implements ISvcLocator.
Definition at line 273 of file Bootstrap.cpp.
00273 { 00274 StatusCode sc = StatusCode::FAILURE; 00275 if ( s_appmgrInstance.isValid() ) { 00276 return s_svclocInstance->getServices( ); 00277 } else { 00278 return s_bootServices; 00279 } 00280 }
| bool Gaudi::BootSvcLocator::existsService | ( | const std::string & | name | ) | const [virtual] |
Check the existence of a service given a service name.
Implements ISvcLocator.
Definition at line 281 of file Bootstrap.cpp.
00281 { 00282 bool result = false; 00283 if ( s_appmgrInstance.isValid() ) { 00284 result = s_svclocInstance->existsService(name); 00285 } 00286 return result; 00287 }
| SmartIF< IService > & Gaudi::BootSvcLocator::service | ( | const Gaudi::Utils::TypeNameString & | typeName, | |
| const bool | createIf = true | |||
| ) | [virtual] |
Returns a smart pointer to a service.
Implements ISvcLocator.
Definition at line 290 of file Bootstrap.cpp.
00290 { 00291 if ( s_appmgrInstance.isValid() ) { 00292 return s_svclocInstance->service(typeName, createIf); 00293 } else { 00294 return s_bootService; 00295 } 00296 }