![]() |
The Gaudi Framework
master (e199b415)
|
#include <GaudiKernel/ServiceHandle.h>
Public Member Functions | |
ServiceHandle (const std::string &serviceName, const std::string &theParentName) | |
Create a handle ('smart pointer') to a service. More... | |
template<typename CT = T, typename NCT = std::remove_const_t<T>> | |
requires (std::is_const_v< CT > &&!std::is_same_v< CT, NCT >) ServiceHandle(const ServiceHandle< NCT > &other) | |
Copy constructor from a non const T to const T service handle. More... | |
template<std::derived_from< IProperty > OWNER> | |
ServiceHandle (OWNER *owner, std::string PropName, const std::string &svcName, std::string doc="") | |
Autodeclaring constructor with property name, service type/name and documentation. More... | |
StatusCode | initialize (const std::string &serviceName, const std::string &theParentName) |
T * | get () const |
Allow non const access to the service, even from a const handle... More... | |
T * | operator-> () const |
Allow non const access to the service, even from a const handle... More... | |
T & | operator* () const |
![]() | |
template<typename CT = T, typename NCT = std::remove_const_t<T>> | |
GaudiHandle (const GaudiHandle< NCT > &other) requires(std | |
Copy constructor needed for correct ref-counting. More... | |
GaudiHandle (const GaudiHandle &other) | |
Copy constructor needed for correct ref-counting. More... | |
template<typename CT = T, typename NCT = std::remove_const_t<T>> | |
requires (std::is_const_v< CT > &&!std::is_same_v< CT, NCT >) GaudiHandle &operator | |
Assignment operator for correct ref-counting. More... | |
virtual StatusCode | release (T *comp) const |
Release the component. More... | |
![]() | |
const std::string & | typeAndName () const |
The full type and name: "type/name". More... | |
std::string | type () const |
The concrete component class name: the part before the '/'. More... | |
std::string | name () const |
The instance name: the part after the '/'. More... | |
bool | empty () const |
Check if the handle has been set to empty string (i.e. More... | |
void | setTypeAndName (std::string myTypeAndName) |
The component "type/name" string. More... | |
void | setName (std::string_view myName) |
Set the instance name (part after the '/') without changing the class type. More... | |
std::string | pythonPropertyClassName () const override |
Name of the componentType with "Handle" appended. More... | |
std::string | messageName () const |
name used for printing messages More... | |
std::string | pythonRepr () const override |
Python representation of handle, i.e. More... | |
![]() | |
virtual | ~GaudiHandleInfo () |
virtual destructor so that derived class destructor is called. More... | |
const std::string & | componentType () const |
const std::string & | propertyName () const |
name as used in declareProperty(name,gaudiHandle) More... | |
void | setPropertyName (std::string propName) |
set name as used in declareProperty(name,gaudiHandle). More... | |
const std::string & | parentName () const |
The name of the parent. More... | |
Protected Member Functions | |
StatusCode | retrieve (T *&service) const override |
Do the real retrieval of the Service. More... | |
template<Gaudi::IsInterface I = T> | |
StatusCode | i_retrieve (I *&service) const |
retrieve the service for ServiceHandles<ISomeInterfaces> More... | |
template<typename I = T> | |
requires (!Gaudi::IsInterface< I >) StatusCode i_retrieve(I *&service) const | |
retrieve the service for ServiceHandles<ActualService> More... | |
![]() | |
GaudiHandle (std::string myTypeAndName, std::string myComponentType, std::string myParentName) | |
![]() | |
GaudiHandleBase (std::string myTypeAndName, std::string myComponentType, std::string myParentName) | |
Create a handle ('smart pointer') to a gaudi component. More... | |
![]() | |
GaudiHandleInfo (std::string myComponentType, std::string myParentName) | |
Some basic information and helper functions shared between various handles/arrays. More... | |
void | setComponentType (std::string componentType) |
The component type. More... | |
void | setParentName (std::string parent) |
The name of the parent. More... | |
Private Member Functions | |
SmartIF< ISvcLocator > & | serviceLocator () const |
SmartIF< IMessageSvc > & | messageSvc () const |
Private Attributes | |
SmartIF< ISvcLocator > | m_pSvcLocator |
SmartIF< IMessageSvc > | m_pMessageSvc |
Additional Inherited Members | |
![]() | |
using | PropertyType = GaudiHandleProperty |
Handle to be used in lieu of naked pointers to services. This allows better control through the framework of service loading and usage.
Definition at line 42 of file ServiceHandle.h.
|
inline |
Create a handle ('smart pointer') to a service.
The arguments are passed on to ServiceSvc, and have the same meaning:
serviceName | name of the service |
parentName | name of the parent Algorithm, AlgTool or Service. It is used for log printout at retrieve(), and for retrieving a thread-dependent service (if applicable) |
Definition at line 54 of file ServiceHandle.h.
|
inline |
Autodeclaring constructor with property name, service type/name and documentation.
Definition at line 65 of file ServiceHandle.h.
|
inline |
Allow non const access to the service, even from a const handle...
Definition at line 90 of file ServiceHandle.h.
|
inlineprotected |
retrieve the service for ServiceHandles<ISomeInterfaces>
Definition at line 102 of file ServiceHandle.h.
|
inline |
Definition at line 71 of file ServiceHandle.h.
|
inlineprivate |
Definition at line 140 of file ServiceHandle.h.
|
inline |
Definition at line 94 of file ServiceHandle.h.
|
inline |
Allow non const access to the service, even from a const handle...
Definition at line 93 of file ServiceHandle.h.
|
inlineprotected |
retrieve the service for ServiceHandles<ActualService>
Definition at line 109 of file ServiceHandle.h.
|
inline |
Copy constructor from a non const T to const T service handle.
Definition at line 59 of file ServiceHandle.h.
|
inlineoverrideprotected |
|
inlineprivate |
Definition at line 130 of file ServiceHandle.h.
|
mutableprivate |
Definition at line 153 of file ServiceHandle.h.
|
mutableprivate |
Definition at line 152 of file ServiceHandle.h.