This is a type-safe wrapper for the IObjGetterTool
interface.
More...
#include <ObjGetterTool.h>
template<class T>
class D3PD::ObjGetterTool< T >
This is a type-safe wrapper for the IObjGetterTool
interface.
The template argument gives the type of object being retrieved. Derived classes should implement the get()
method, to retrieve an object, and optionally releaseObject() to dispose of an object.
Definition at line 34 of file ObjGetterTool.h.
◆ ObjGetterTool()
Standard Gaudi tool constructor.
- Parameters
-
type | The name of the tool type. |
name | The tool name. |
parent | The tool's Gaudi parent. |
◆ configureTypeinfo()
StatusCode D3PD::ObjGetterToolImpl::configureTypeinfo |
( |
const std::type_info & |
ti | ) |
|
|
virtualinherited |
Test type compatibility.
- Parameters
-
Test to see if the object being returned by the tool can be converted to a pointer to T
. This can be used to perform type checks during job initialization.
Definition at line 124 of file ObjGetterToolImpl.cxx.
◆ get()
Return the target object.
- Parameters
-
allowMissing | If true, then we should not generate errors if the requested object is missing. |
Return 0 on failure.
◆ getTypeinfo()
const void * D3PD::ObjGetterToolImpl::getTypeinfo |
( |
const std::type_info & |
ti, |
|
|
bool |
allowMissing = false |
|
) |
| |
|
virtualinherited |
Return the target object cast to a different pointer type.
- Parameters
-
ti | The desired type. |
allowMissing | If true, then we should not generate errors if the requested object is missing. |
Return the object as a pointer to the ti
type. Return 0 if the get fails or if the pointer can't be converted.
Definition at line 45 of file ObjGetterToolImpl.cxx.
50 this->m_converter.dstTypeinfo() != ti)
57 const void*
p = this->getUntyped (allowMissing);
◆ getUntyped()
Return the target object.
- Parameters
-
allowMissing | If true, then we should not generate errors if the requested object is missing. |
Should be of the type given by typeinfo
. Return 0 on failure.
◆ releaseObject()
Release an object retrieved from the getter.
- Parameters
-
Call this when you are done with the object returned by get()
. The default implementation is a no-op, but if the getter dynamically allocated the object which it returned, this gives it a chance to free it.
◆ releaseObjectTypeinfo()
void D3PD::ObjGetterToolImpl::releaseObjectTypeinfo |
( |
const void * |
p, |
|
|
const std::type_info & |
ti |
|
) |
| |
|
inherited |
Release an object retrieved from the getter.
- Parameters
-
p | The object to release. |
ti | The type of p. |
Call this when you are done with the object returned by getUntyped()
. The default implementation is a no-op, but if the getter dynamically allocated the object which it returned, this gives it a chance to free it.
Definition at line 82 of file ObjGetterToolImpl.cxx.
90 this->m_backConverter.srcTypeinfo() != ti)
94 <<
"Can't configure pointer conversion from "
95 << System::typeinfoName (ti) <<
" to "
96 << System::typeinfoName (this->typeinfo());
106 this->releaseObjectUntyped (
p);
◆ releaseObjectUntyped()
Release an object retrieved from the getter.
- Parameters
-
Call this when you are done with the object returned by getUntyped()
. The default implementation is a no-op, but if the getter dynamically allocated the object which it returned, this gives it a chance to free it.
◆ typeinfo()
Return the type of object retrieved by this tool.
◆ m_backConverter
◆ m_converter
The documentation for this class was generated from the following file: