ATLAS Offline Software
|
Abstract interface to get an object to put in the tuple. More...
#include <IObjGetterTool.h>
Public Member Functions | |
DeclareInterfaceID (IObjGetterTool, 1, 0) | |
Gaudi interface definition. More... | |
virtual const std::type_info & | typeinfo () const =0 |
Return the type of object retrieved by this tool. More... | |
virtual const void * | getUntyped (bool allowMissing=false)=0 |
Return the target object. More... | |
template<class T > | |
const T * | get (bool allowMissing=false) |
Type-safe wrapper for get . More... | |
virtual void | releaseObjectUntyped (const void *p) |
Release an object retrieved from the getter. More... | |
template<class T > | |
void | releaseObject (const T *p) |
Type-safe wrapper for releaseObjectUntyped . More... | |
template<class T > | |
StatusCode | configureD3PD () |
Test type compatibility. More... | |
virtual const void * | getTypeinfo (const std::type_info &ti, bool allowMissing=false)=0 |
Return the target object cast to a different pointer type. More... | |
void | releaseObjectTypeinfo (const void *p, const std::type_info &ti) |
Release an object retrieved from the getter. More... | |
virtual StatusCode | configureTypeinfo (const std::type_info &ti)=0 |
Test type compatibility. More... | |
Abstract interface to get an object to put in the tuple.
The input to an object filler tool is provided by a tool of type IObjGetterTool
. This will return an object or an object container of a given type. It is expected that the usual case for this will be to fetch an object from StoreGate; generic code will be provided for this case and for the case of retrieving the results of a particle selection algorithm. Other tools can be defined for specific special cases, such as using selections stored in a top inputs object, or for performing additional selections.
User-defined getters generally shouldn't implement this interface directly, but instead use the type-safe wrappers provided by ObjGetterTool
.
Once you're done with the object, you should call releaseObject(). This will usually be a no-op, but it allows the getter to return a dynamically-allocated object.
Definition at line 45 of file IObjGetterTool.h.
StatusCode D3PD::IObjGetterTool::configureD3PD | ( | ) |
|
pure virtual |
D3PD::IObjGetterTool::DeclareInterfaceID | ( | IObjGetterTool | , |
1 | , | ||
0 | |||
) |
Gaudi interface definition.
const T* D3PD::IObjGetterTool::get | ( | bool | allowMissing = false | ) |
Type-safe wrapper for get
.
allowMissing | If true, then we should not generate errors if the requested object is missing. |
Return the object as a pointer to T
. Return 0 if the get fails or if the pointer can't be converted.
This is implemented in terms of getTypeinfo()
.
|
pure 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.
|
pure virtual |
Return the target object.
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.
Implemented in D3PD::SGGetterImpl, D3PD::SGCollectionGetterTool< CONT >, D3PD::SGCollectionGetterTool< Obj4Container >, D3PD::SGCollectionGetterTool< TileDigitsContainer >, D3PD::SGCollectionGetterTool< CaloCalibrationHitContainer >, D3PD::SGCollectionGetterTool< TileHitVector >, D3PD::SGCollectionGetterTool< TrackRecordCollection >, D3PD::SGCollectionGetterTool< TileRawChannelContainer >, D3PD::SGCollectionGetterTool< LArHitContainer >, D3PD::SGCollectionGetterTool< INav4MomLinkContainer >, D3PD::SGCollectionGetterTool< LArRawChannelContainer >, and D3PD::SGCollectionGetterTool< IParticleLinks >.
void D3PD::IObjGetterTool::releaseObject | ( | const T * | p | ) |
Type-safe wrapper for releaseObjectUntyped
.
p | The object to release. |
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.
This is implemented in terms of releaseObjectTypeinfo()
.
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.
|
virtual |
Release an object retrieved from the getter.
p | The object to release. |
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.
|
pure virtual |
Return the type of object retrieved by this tool.
Implemented in D3PD::SGGetterImpl, D3PD::SGCollectionGetterTool< CONT >, D3PD::SGTileDigitsGetterTool, D3PD::SGTileHitGetterTool, D3PD::SGTileModuleBitsGetterTool, and D3PD::SGTileRawChannelGetterTool.