41 #if !defined( GAUDI_V22_API ) || defined( G22_NEW_SVCLOCATOR ) 45 const bool createIf =
true )
override;
64 if ( !s_appmgrInstance ) {
66 s_svclocInstance = s_appmgrInstance;
68 return s_appmgrInstance.
get();
78 return iif ? iif.as<
IAppMgrUI>().
get() :
nullptr;
98 if ( !s_svclocInstance ) {
101 s_svclocInstance = iappmgr;
102 if ( s_svclocInstance )
return s_svclocInstance;
115 return s_svclocInstance;
123 s_svclocInstance = newInstance;
124 s_appmgrInstance = s_svclocInstance;
133 s_appmgrInstance = newInstance;
134 s_svclocInstance = s_appmgrInstance;
145 IService* is = Service::Factory::create( factname, name,
nullptr ).release();
147 IAlgorithm* ia = Algorithm::Factory::create( factname, name,
nullptr ).release();
150 void* libHandle =
nullptr;
152 ii = ObjFactory::create( factname,
nullptr ).
release();
154 is = Service::Factory::create( factname, name,
nullptr ).release();
156 ia = Algorithm::Factory::create( factname, name,
nullptr ).release();
188 #if !defined( GAUDI_V22_API ) || defined( G22_NEW_SVCLOCATOR ) 192 if ( s_appmgrInstance ) {
193 sc = s_svclocInstance->
getService( typeName, iid, pinterface );
195 pinterface = s_bootInterface.
get();
200 const bool createIf ) {
202 if ( s_appmgrInstance ) {
203 sc = s_svclocInstance->
getService( typeName, svc, createIf );
205 svc = s_bootService.
get();
212 return s_appmgrInstance ? s_svclocInstance->
getServices() : s_bootServices;
215 return s_appmgrInstance && s_svclocInstance->
existsService( name );
219 return s_appmgrInstance ? s_svclocInstance->
service( typeName, createIf ) : s_bootService;
Base class used to implement the interfaces.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
bool existsService(const std::string &name) const override
virtual bool existsService(const std::string &name) const =0
Check the existence of a service given a service name.
const std::list< IService * > & getServices() const override
GAUDI_API IAppMgrUI * createApplicationMgrEx(const std::string &dllname, const std::string &factname)
TYPE * get() const
Get interface pointer.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Helper class to parse a string of format "type/name".
GAUDI_API ISvcLocator * svcLocator()
SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true) override
Returns a smart pointer to a service.
General service interface definition.
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
virtual StatusCode getService(const Gaudi::Utils::TypeNameString &typeName, IService *&svc, const bool createIf=true)
Get a reference to the service given a service name.
The IAlgorithm is the interface implemented by the Algorithm base class.
Application Manager User Interface.
GAUDI_API ISvcLocator * setInstance(ISvcLocator *newInstance)
Set new instance of service locator.
virtual unsigned long release()=0
Release Interface instance.
StatusCode getService(const Gaudi::Utils::TypeNameString &typeName, const InterfaceID &iid, IInterface *&pinterface) override
virtual const std::list< IService * > & getServices() const =0
Get a reference to a service and create it if it does not exists.
A dual-stage boostrap mechanism is used to ensure an orderly startup of the ApplicationMgr.
constexpr static const auto FAILURE
SmartIF< IFace > make_SmartIF(IFace *iface)
GAUDI_API const std::string getLastErrorString()
Get last system error as string.
std::string typeName(const std::type_info &typ)
Header file for std:chrono::duration-based Counters.
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.