39 #if !defined(GAUDI_V22_API)|| defined(G22_NEW_SVCLOCATOR)
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;
213 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;
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
virtual bool existsService(const std::string &name) const
Check the existence of a service given a service name.
bool isSuccess() const
Test for a status code of SUCCESS.
virtual ~BootSvcLocator()
GAUDI_API IAppMgrUI * createApplicationMgrEx(const std::string &dllname, const std::string &factname)
bool isFailure() const
Test for a status code of FAILURE.
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)
Returns a smart pointer to a service.
Gaudi::InterfaceId< IInterface, 0, 0 > iid
Interface ID.
Base class used to implement the interfaces.
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.
Helper class to parse a string of format "type/name".
GAUDI_API ISvcLocator * svcLocator()
bool isValid() const
Allow for check if smart pointer is valid.
General service interface definition.
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
TYPE * get() const
Get interface pointer.
The IAlgorithm is the interface implemented by the Algorithm base class.
virtual const std::list< IService * > & getServices() const
Get a reference to a service and create it if it does not exists.
Application Manager User Interface.
GAUDI_API ISvcLocator * setInstance(ISvcLocator *newInstance)
Set new instance of service locator.
virtual unsigned long release()=0
Release Interface instance.
A dual-stage boostrap mechanism is used to ensure an orderly startup of the ApplicationMgr.
GAUDI_API const std::string getLastErrorString()
Get last system error as string.
This is a number of static methods for bootstrapping the Gaudi framework.
std::string typeName(const std::type_info &typ)
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
GAUDI_API IInterface * createInstance(const std::string &name, const std::string &factname, const std::string &ddlname)
GAUDI_API IAppMgrUI * createApplicationMgr(const std::string &dllname, const std::string &factname)
GAUDI_API unsigned long loadDynamicLib(const std::string &name, ImageHandle *handle)
Load dynamic link library.
virtual StatusCode queryInterface(const InterfaceID &ti, void **pp)=0
Set the void** to the pointer to the requested interface of the instance.