ATLAS Offline Software
|
Non-template parts of ObjGetterTool
.
More...
#include <ObjGetterToolImpl.h>
Public Member Functions | |
ObjGetterToolImpl (const std::string &type, const std::string &name, const IInterface *parent) | |
Standard Gaudi tool constructor. More... | |
virtual const void * | getTypeinfo (const std::type_info &ti, bool allowMissing=false) |
Return the target object cast to a different pointer type. More... | |
virtual StatusCode | configureTypeinfo (const std::type_info &ti) |
Test type compatibility. More... | |
void | releaseObjectTypeinfo (const void *p, const std::type_info &ti) |
Release an object retrieved from the getter. More... | |
Private Attributes | |
TypeConverter | m_converter |
Helper to convert pointers. More... | |
TypeConverter | m_backConverter |
Helper to convert pointers back, for releaseObject . More... | |
Non-template parts of ObjGetterTool
.
The class ObjGetterTool
provides a type-safe wrapper for the IObjGetterTool
interface; it is templated on the type of object on which it retrieves. This class serves as a common base class for the ObjGetterToolTool
instantiations, and factors out all the code that doesn't depend on the template argument. It may also be useful for other getter classes that don't use ObjGetterTool
.
Definition at line 39 of file ObjGetterToolImpl.h.
|
virtual |
Test type compatibility.
ti | The desired type. |
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.
|
virtual |
Return the target object cast to a different pointer type.
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.
Release an object retrieved from the getter.
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.
|
private |
Helper to convert pointers back, for releaseObject
.
Definition at line 97 of file ObjGetterToolImpl.h.
|
private |
Helper to convert pointers.
Definition at line 94 of file ObjGetterToolImpl.h.