#include <ObjectIter.h>
Inherits MemoryPoolObject.
Inherited by SimpleObjectIterator.
Public Member Functions | |
| virtual Object * | first ()=0 |
| reset iterator and return first item (or null if iter is empty) | |
| virtual Object * | next ()=0 |
| advance and return next item (or null if no more to iterate) | |
Public Member Functions inherited from MemoryPoolObject | |
| void | deleteInstance () |
Additional Inherited Members | |
Protected Member Functions inherited from MemoryPoolObject | |
| virtual | ~MemoryPoolObject () |
| void * | operator new (size_t s) |
| void | operator delete (void *p) |
| virtual MemoryPool * | getObjectMemoryPool ()=0 |
ObjectIterator is an ABC that's used to iterate over an arbitrary list of Objects. (duh!)
As of this writing, only PartitionManager actually provides an instance of this, but it seems fairly likely that other folks might want to in the future, so here it is.
typical usage:
iter = ThePartitionManager->iterateInRange(...); for (Object *otherObject = iter->first(); otherObject; otherObject = iter->next()) { do something with other } iter->deleteInstance(); // you own it, so you must delete it
note that the iterator is required to deal intelligently with deleted objects; in particular, next() will check if an obj has been killed and simply skip it.
Definition at line 75 of file ObjectIter.h.
|
pure virtual |
reset iterator and return first item (or null if iter is empty)
Implemented in SimpleObjectIterator.
|
pure virtual |
advance and return next item (or null if no more to iterate)
Implemented in SimpleObjectIterator.