ATLAS Offline Software
Public Member Functions | List of all members
D3PD::IIteration Class Referenceabstract

Abstract interface for iterating over a set of things. More...

#include <IIteration.h>

Inheritance diagram for D3PD::IIteration:
Collaboration diagram for D3PD::IIteration:

Public Member Functions

virtual ~IIteration ()
 This is a polymorphic class. 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...
 

Detailed Description

Abstract interface for iterating over a set of things.

There are a couple places where we provide an interface for iterating over a set of objects; ICollectionGetterTool and IMultiAssociationTool are two. This interface collects from these the methods that are common to the actual iteration. Some of the core code involved in iteration is non-trivial (such as wrapping variables in vectors) and we'd like to use the same code for getters and associators.

Note that generally the iteration must be initialized before starting to call next*. That's not covered by this interface; it should be specified in a derived interface.

Once you're done with an object, you should call releaseElement(). This will usually be a no-op, but it allows the getter to return a dynamically-allocated object.

Definition at line 40 of file IIteration.h.

Constructor & Destructor Documentation

◆ ~IIteration()

virtual D3PD::IIteration::~IIteration ( )
inlinevirtual

This is a polymorphic class.

Definition at line 44 of file IIteration.h.

44 {}

Member Function Documentation

◆ elementTypeinfo()

virtual const std::type_info& D3PD::IIteration::elementTypeinfo ( ) const
pure virtual

Return the element type of the collection.

I.e., nextUntyped returns a pointer to this type.

◆ nextUntyped()

virtual const void* D3PD::IIteration::nextUntyped ( )
pure virtual

Return a pointer to the next element in the iteration.

Return 0 when the collection has been exhausted.

◆ releaseElementUntyped()

virtual void D3PD::IIteration::releaseElementUntyped ( const void *  p)
virtual

Release an object retrieved from the getter.

Parameters
pThe 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.


The documentation for this class was generated from the following file: