![]() |
The Gaudi Framework
v36r9 (fd2bdac3)
|
#include <GaudiKernel/GaudiHandle.h>


Public Member Functions | |
| template<typename CT = T, typename NCT = std::remove_const_t<T>> | |
| GaudiHandle (const GaudiHandle< NCT > &other, std::enable_if_t< std::is_const_v< CT > &&!std::is_same_v< CT, NCT >> *=nullptr) | |
| 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>> | |
| std::enable_if_t< std::is_const_v< CT > &&!std::is_same_v< CT, NCT >, GaudiHandle & > | operator= (const GaudiHandle< NCT > &other) |
| Assignment operator 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... | |
| bool | isValid () const |
| Check if the handle is valid (try to retrive the object is not done yet). More... | |
| operator bool () const | |
| For testing if handle has component. More... | |
| T * | get () |
| Return the wrapped pointer, not calling retrieve() if null. More... | |
| std::add_const_t< T > * | get () const |
| Return the wrapped pointer, not calling retrieve() if null. More... | |
| bool | isSet () const |
| True if the wrapped pointer is not null. More... | |
| T & | operator* () |
| T * | operator-> () |
| std::add_const_t< T > & | operator* () const |
| std::add_const_t< 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 (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... | |
Public Member Functions inherited from GaudiHandleInfo | |
| virtual | ~GaudiHandleInfo ()=default |
| 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 | |
| GaudiHandle (std::string myTypeAndName, std::string myComponentType, 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 (std::string myTypeAndName, std::string myComponentType, std::string myParentName) | |
| Create a handle ('smart pointer') to a gaudi component. More... | |
Protected Member Functions inherited from GaudiHandleInfo | |
| 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 | |
| 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... | |
| void | assertObject () const |
| Load the pointer to the component. More... | |
Private Attributes | |
| std::atomic< T * > | m_pObject = nullptr |
Additional Inherited Members | |
Public Types inherited from GaudiHandleBase | |
| using | PropertyType = GaudiHandleProperty |
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 173 of file GaudiHandle.h.
|
inlineprotected |
Definition at line 178 of file GaudiHandle.h.
|
inline |
|
inline |
|
inlineprivate |
Load the pointer to the component.
Do a retrieve if needed. Throw an exception if retrieval fails.
Definition at line 322 of file GaudiHandle.h.
|
inline |
Return the wrapped pointer, not calling retrieve() if null.
Definition at line 260 of file GaudiHandle.h.
|
inline |
Return the wrapped pointer, not calling retrieve() if null.
Definition at line 263 of file GaudiHandle.h.
|
inline |
Definition at line 293 of file GaudiHandle.h.
|
inline |
Helper function to get default type string from the class type.
Definition at line 291 of file GaudiHandle.h.
|
inline |
|
inline |
Check if the handle is valid (try to retrive the object is not done yet).
Definition at line 247 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 254 of file GaudiHandle.h.
|
inline |
Definition at line 268 of file GaudiHandle.h.
|
inline |
Definition at line 278 of file GaudiHandle.h.
|
inline |
Definition at line 273 of file GaudiHandle.h.
|
inline |
Definition at line 284 of file GaudiHandle.h.
|
inline |
Assignment operator for correct ref-counting.
Definition at line 211 of file GaudiHandle.h.
|
inline |
Assignment operator for correct ref-counting.
Definition at line 200 of file GaudiHandle.h.
|
inline |
|
inlineprotectedvirtual |
Release the component.
Default implementation calls release() on the component. Can be overridden by the derived class if something else is needed.
Reimplemented in ToolHandle< T >, ToolHandle< IThreadInitTool >, ToolHandle< IMyTool >, ToolHandle< IMyOtherTool >, ToolHandle< IAlgTool >, ToolHandle< GaudiTesting::ITestTool >, ToolHandle< Gaudi::Tests::Histograms::Directories::HistoGroupsTool >, ToolHandle< Gaudi::Examples::FloatTool >, and ToolHandle< const IMyTool >.
Definition at line 304 of file GaudiHandle.h.
|
inline |
Retrieve the component.
Release existing component if needed.
Definition at line 222 of file GaudiHandle.h.
|
protectedpure virtual |
Retrieve the component.
To be implemented by the derived class. It will pass the pointer
Implemented in ServiceHandle< T >, ToolHandle< T >, ServiceHandle< IToolSvc >, ToolHandle< IThreadInitTool >, ToolHandle< IMyTool >, ToolHandle< IMyOtherTool >, ServiceHandle< IInterface >, ToolHandle< IAlgTool >, ToolHandle< GaudiTesting::ITestTool >, ToolHandle< Gaudi::Tests::Histograms::Directories::HistoGroupsTool >, ToolHandle< Gaudi::Examples::FloatTool >, and ToolHandle< const IMyTool >.
|
inlineprivate |
Helper function to set default type from the class type T.
Definition at line 318 of file GaudiHandle.h.
|
inlineprivate |
|
mutableprivate |
Definition at line 333 of file GaudiHandle.h.