![]() |
The Gaudi Framework
v25r3
|
Handle to be used in lieu of naked pointers to services. More...
#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... | |
StatusCode | retrieve () const |
Retrieve the Service. More... | |
![]() | |
GaudiHandle (const GaudiHandle &other) | |
Copy constructor needed for correct ref-counting. More... | |
GaudiHandle & | operator= (const GaudiHandle &other) |
Assignment operator for correct ref-counting. More... | |
StatusCode | retrieve () const |
Retrieve the component. More... | |
StatusCode | release () const |
Release the component. More... | |
operator bool () const | |
For testing if handle has component. More... | |
T & | operator* () |
T * | operator-> () |
T & | operator* () const |
T * | operator-> () const |
std::string | getDefaultType () |
Helper function to get default type string from the class type. More... | |
std::string | getDefaultName () |
![]() | |
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 (const std::string &myTypeAndName) |
The component "type/name" string. More... | |
void | setName (const std::string &myName) |
Set the instance name (part after the '/') without changing the class type. More... | |
const std::string | pythonPropertyClassName () const |
Name of the componentType with "Handle" appended. More... | |
const std::string | messageName () const |
name used for printing messages More... | |
virtual const std::string | pythonRepr () const |
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 (const 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 |
Release the Service. More... | |
![]() | |
GaudiHandle (const std::string &myTypeAndName, const std::string &myComponentType, const std::string &myParentName) | |
virtual StatusCode | release (T *comp) const |
Release the component. More... | |
![]() | |
GaudiHandleBase (const std::string &myTypeAndName, const std::string &myComponentType, const std::string &myParentName) | |
Create a handle ('smart pointer') to a gaudi component. More... | |
![]() | |
GaudiHandleInfo (const std::string &myComponentType, const std::string &myParentName) | |
Some basic information and helper functions shared between various handles/arrays. More... | |
Private Member Functions | |
SmartIF< ISvcLocator > & | serviceLocator () const |
Do the real release of the Service. More... | |
SmartIF< IMessageSvc > & | messageSvc () const |
Private Attributes | |
SmartIF< ISvcLocator > | m_pSvcLocator |
SmartIF< IMessageSvc > | m_pMessageSvc |
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 25 of file PropertyMgr.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 42 of file ServiceHandle.h.
|
inlineprivate |
Definition at line 84 of file ServiceHandle.h.
|
inline |
Retrieve the Service.
Release existing Service if needed. Function must be repeated here to avoid hiding the function retrieve( T*& )
Definition at line 48 of file ServiceHandle.h.
|
inlineprotectedvirtual |
Release the Service.
Function must be repeated here to avoid hiding the function release( T*& ) Do the real retrieval of the Service.
Implements GaudiHandle< T >.
Definition at line 60 of file ServiceHandle.h.
|
inlineprivate |
Do the real release of the Service.
Definition at line 74 of file ServiceHandle.h.
|
mutableprivate |
Definition at line 98 of file ServiceHandle.h.
|
mutableprivate |
Definition at line 97 of file ServiceHandle.h.