![]() |
The Gaudi Framework
v25r3
|
Handle to be used in lieu of naked pointers to gaudis. More...
#include <GaudiKernel/GaudiHandle.h>


Public Member Functions | |
| 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 () |
Public Member Functions inherited from GaudiHandleBase | |
| 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... | |
Public Member Functions inherited from GaudiHandleInfo | |
| 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 | |
| GaudiHandle (const std::string &myTypeAndName, const std::string &myComponentType, const std::string &myParentName) | |
| virtual StatusCode | retrieve (T *&) const =0 |
| Retrieve the component. More... | |
| virtual StatusCode | release (T *comp) const |
| Release the component. More... | |
Protected Member Functions inherited from GaudiHandleBase | |
| GaudiHandleBase (const std::string &myTypeAndName, const std::string &myComponentType, const std::string &myParentName) | |
| Create a handle ('smart pointer') to a gaudi component. More... | |
Protected Member Functions inherited from GaudiHandleInfo | |
| GaudiHandleInfo (const std::string &myComponentType, const std::string &myParentName) | |
| Some basic information and helper functions shared between various handles/arrays. More... | |
Private Member Functions | |
| void | setDefaultTypeAndName () |
| Helper function to set default name and type. More... | |
| void | setDefaultType () |
| Helper function to set default type from the class type T. More... | |
| bool | getObject () const |
| Load the pointer to the component. More... | |
| void | assertObject () const |
| Load the pointer to the component. More... | |
Private Attributes | |
| T * | m_pObject |
Handle to be used in lieu of naked pointers to gaudis.
This allows better control through the framework of gaudi loading and usage. T is the type of the component interface (or concrete class).
Definition at line 158 of file GaudiHandle.h.
|
inlineprotected |
Definition at line 163 of file GaudiHandle.h.
|
inline |
Copy constructor needed for correct ref-counting.
Definition at line 170 of file GaudiHandle.h.
|
inlineprivate |
Load the pointer to the component.
Do a retrieve if needed. Throw an exception if retrieval fails.
Definition at line 274 of file GaudiHandle.h.
|
inline |
Definition at line 238 of file GaudiHandle.h.
|
inline |
Helper function to get default type string from the class type.
Definition at line 234 of file GaudiHandle.h.
|
inlineprivate |
Load the pointer to the component.
Do a retrieve if needed
Definition at line 268 of file GaudiHandle.h.
|
inline |
For testing if handle has component.
Does retrieve() if needed. If this returns false, the component could not be retrieved.
Definition at line 209 of file GaudiHandle.h.
|
inline |
Definition at line 213 of file GaudiHandle.h.
|
inline |
Definition at line 223 of file GaudiHandle.h.
|
inline |
Definition at line 218 of file GaudiHandle.h.
|
inline |
Definition at line 228 of file GaudiHandle.h.
|
inline |
|
inline |
Release the component.
Definition at line 198 of file GaudiHandle.h.
|
inlineprotectedvirtual |
Release the component.
Default implementation calls release() on the component. Can be overridden by the derived class if something else if needed.
Reimplemented in ToolHandle< T >.
Definition at line 250 of file GaudiHandle.h.
|
inline |
Retrieve the component.
Release existing component if needed.
Definition at line 188 of file GaudiHandle.h.
|
protectedpure virtual |
Retrieve the component.
To be implemented by the derived class. It will pass the pointer
Implemented in ToolHandle< T >, ServiceHandle< T >, and ServiceHandle< IToolSvc >.
|
inlineprivate |
Helper function to set default type from the class type T.
Definition at line 263 of file GaudiHandle.h.
|
inlineprivate |
Helper function to set default name and type.
Definition at line 257 of file GaudiHandle.h.
|
mutableprivate |
Definition at line 283 of file GaudiHandle.h.