ATLAS Offline Software
|
Abstract interface to get a collection of objects and iterate over it. More...
#include <ICollectionGetterTool.h>
Public Member Functions | |
DeclareInterfaceID (ICollectionGetterTool, 1, 0) | |
Gaudi interface definition. More... | |
virtual StatusCode | reset (bool allowMissing=false)=0 |
Reset the iteration to the start of the collection. More... | |
virtual size_t | sizeHint (bool allowMissing=false)=0 |
Return an estimate of the number of elements in the iteration. More... | |
template<class T > | |
const T * | next () |
Type-safe wrapper for next . More... | |
template<class T > | |
StatusCode | configureD3PD () |
Test type compatibility. More... | |
virtual const void * | nextTypeinfo (const std::type_info &ti)=0 |
Return the next object cast to a different pointer type. More... | |
virtual StatusCode | configureElementTypeinfo (const std::type_info &ti)=0 |
Test type compatibility. More... | |
template<class T > | |
void | releaseElement (const T *p) |
Type-safe wrapper for releaseElementUntyped . More... | |
void | releaseElementTypeinfo (const void *p, const std::type_info &ti) |
Release an element retrieved from the getter. More... | |
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... | |
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... | |
virtual const std::type_info & | elementTypeinfo () const =0 |
Return the element type of the collection. More... | |
virtual const void * | nextUntyped ()=0 |
Return a pointer to the next element in the iteration. More... | |
virtual void | releaseElementUntyped (const void *p) |
Release an object retrieved from the getter. More... | |
Abstract interface to get a collection of objects and iterate over it.
This extends the IObjGetterTool
interface to allow iterating over the objects within a container.
The iteration is started by calling reset()
. After that, call #nextUntyped()
repeatedly until it returns 0.
Definition at line 36 of file ICollectionGetterTool.h.
StatusCode D3PD::ICollectionGetterTool::configureD3PD | ( | ) |
|
pure virtual |
|
pure virtualinherited |
D3PD::ICollectionGetterTool::DeclareInterfaceID | ( | ICollectionGetterTool | , |
1 | , | ||
0 | |||
) |
Gaudi interface definition.
|
inherited |
Gaudi interface definition.
|
pure virtualinherited |
Return the element type of the collection.
I.e., nextUntyped
returns a pointer to this type.
|
inherited |
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 virtualinherited |
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 virtualinherited |
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 >.
const T* D3PD::ICollectionGetterTool::next | ( | ) |
Type-safe wrapper for next
.
Return the next element from the collection as a pointer to T
. Return 0 if the pointer can't be converted or at the end of the iteration.
This is implemented in terms of nextTypeinfo()
.
|
pure virtual |
Return the next object cast to a different pointer type.
Return the next element from the collection as a pointer to the ti
type. Return 0 if the pointer can't be converted or at the end of the iteration.
|
pure virtualinherited |
Return a pointer to the next element in the iteration.
Return 0 when the collection has been exhausted.
void D3PD::ICollectionGetterTool::releaseElement | ( | const T * | p | ) |
Type-safe wrapper for releaseElementUntyped
.
p | The element to release. |
Call this when you are done with the object returned by next()
. 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 releaseElementTypeinfo()
.
void D3PD::ICollectionGetterTool::releaseElementTypeinfo | ( | const void * | p, |
const std::type_info & | ti | ||
) |
Release an element retrieved from the getter.
p | The element to release. |
ti | The type of p. |
Call this when you are done with the element returned by nextUntyped()
. 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.
|
virtualinherited |
Release an object retrieved from the getter.
p | The object to release. |
Call this when you are done with the object returned by nextUntyped()
. 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.
|
inherited |
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()
.
|
inherited |
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.
|
virtualinherited |
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 |
Reset the iteration to the start of the collection.
allowMissing | If true, then we should not generate errors if the requested object is missing. |
Return failure if the container cannot be retrieved.
|
pure virtual |
Return an estimate of the number of elements in the iteration.
allowMissing | If true, then we should not generate errors if the requested object is missing. |
This can be used to pre-allocate memory. (It's possible that this isn't known in advance of iterating over the entire collection, for example if a selection is being applied, so this is only a hint.)
|
pure virtualinherited |
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.