1 #ifndef GAUDIKERNEL_ISVCLOCATOR_H
2 #define GAUDIKERNEL_ISVCLOCATOR_H 1
5 #include "GaudiKernel/IInterface.h"
6 #include "GaudiKernel/ISvcManager.h"
7 #include "GaudiKernel/TypeNameString.h"
8 #include "GaudiKernel/SmartIF.h"
30 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
36 IService*& svc,
const bool createIf =
true) {
54 auto svc = service(typeName,
false);
55 return svc ? svc->queryInterface(iid, (
void**)&pinterface)
70 virtual const std::list<IService*> &getServices()
const = 0;
73 virtual bool existsService(
const std::string&
name)
const = 0;
75 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
89 StatusCode service(
const std::string&
type,
const std::string& name,
90 T*& svc,
bool createIf =
true ) {
91 return service(type +
"/" + name, svc, createIf);
101 return SmartIF<T>{ service(typeName, createIf) };
105 template <
typename IFace>
111 #endif // GAUDI_ISVCLOCATOR_H
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
bool isSuccess() const
Test for a status code of SUCCESS.
TYPE * get() const
Get interface pointer.
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
Helper class to parse a string of format "type/name".
General service interface definition.
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
std::string typeName(const std::type_info &typ)
IInterface *PyHelper() getService(IInterface *app, char *name)