2 #ifndef GAUDIKERNEL_ISVCLOCATOR_H
3 #define GAUDIKERNEL_ISVCLOCATOR_H 1
31 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
37 IService*& svc,
const bool createIf =
true) {
58 return svc->queryInterface(iid, (
void**)&pinterface);
74 virtual const std::list<IService*> &getServices()
const = 0;
77 virtual bool existsService(
const std::string& name)
const = 0;
79 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR)
88 return getService( name, T::interfaceID(), (
IInterface*&)svc );
94 T*& svc,
bool createIf =
true ) {
95 return service(type +
"/" + name, svc, createIf);
103 template <
typename T>
105 return SmartIF<T>(service(typeName, createIf));
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.
SmartIF< T > service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)
Returns a smart pointer to the requested interface of a service.
StatusCode service(const std::string &type, const std::string &name, T *&svc, bool createIf=true)
Templated method to access a service by type and name.
Gaudi::InterfaceId< IInterface, 0, 0 > iid
Interface ID.
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".
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.
#define DeclareInterfaceID(name, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
virtual StatusCode getService(const Gaudi::Utils::TypeNameString &typeName, IService *&svc, const bool createIf=true)
Get a reference to the service given a service name.
TYPE * get() const
Get interface pointer.
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 unsigned long addRef()=0
Increment the reference count of Interface instance.
std::string typeName(const std::type_info &typ)