3 #include "GaudiKernel/Bootstrap.h"
4 #include "GaudiKernel/System.h"
6 #include "GaudiKernel/IInterface.h"
7 #include "GaudiKernel/IAlgorithm.h"
8 #include "GaudiKernel/IService.h"
9 #include "GaudiKernel/IAppMgrUI.h"
10 #include "GaudiKernel/ISvcLocator.h"
11 #include "GaudiKernel/IClassManager.h"
13 #include "GaudiKernel/ObjectFactory.h"
14 #include "GaudiKernel/Service.h"
15 #include "GaudiKernel/Algorithm.h"
39 #if !defined(GAUDI_V22_API)|| defined(G22_NEW_SVCLOCATOR)
43 virtual StatusCode getService(
const Gaudi::Utils::TypeNameString& typeName,
45 const bool createIf =
true);
47 virtual const std::list<IService*>&
getServices( )
const;
62 const std::string& factname)
67 if ( !s_appmgrInstance.
isValid() ) {
69 s_svclocInstance = s_appmgrInstance;
71 return s_appmgrInstance.
get();
76 const std::string& factname)
114 if( !s_svclocInstance.
isValid() ) {
117 s_svclocInstance = iappmgr;
118 if( s_svclocInstance.
isValid() ) {
119 return s_svclocInstance;
133 return s_svclocInstance;
141 s_svclocInstance = newInstance;
142 s_appmgrInstance = s_svclocInstance;
151 s_appmgrInstance = newInstance;
152 s_svclocInstance = s_appmgrInstance;
158 const std::string& factname,
159 const std::string& dllname)
174 ii = ObjFactory::create(factname, (
IInterface*)0);
176 is = Service::Factory::create(factname, name, (
ISvcLocator*)0);
178 ia = Algorithm::Factory::create(factname, name, (
ISvcLocator*)0);
186 std::cout <<
"Gaudi::Bootstrap: Not found DLL " << dllname << std::endl;
207 static std::list<IService*> s_bootServices;
211 using Gaudi::BootSvcLocator;
213 BootSvcLocator::BootSvcLocator() {
215 BootSvcLocator::~BootSvcLocator() {
218 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
223 if ( s_appmgrInstance.
isValid() ) {
224 sc = s_svclocInstance->getService(typeName, iid, pinterface );
226 pinterface = s_bootInterface.
get();
232 const bool createIf ) {
234 if ( s_appmgrInstance.
isValid() ) {
235 sc = s_svclocInstance->getService(typeName, svc, createIf );
237 svc = s_bootService.
get();
245 if ( s_appmgrInstance.
isValid() ) {
246 return s_svclocInstance->getServices( );
248 return s_bootServices;
253 if ( s_appmgrInstance.
isValid() ) {
254 result = s_svclocInstance->existsService(name);
261 if ( s_appmgrInstance.
isValid() ) {
262 return s_svclocInstance->service(typeName, createIf);
264 return s_bootService;