Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
SimpleObjectIterator Class Reference

#include <ObjectIter.h>

Inherits ObjectIterator.

Public Member Functions

 SimpleObjectIterator ()
 
Object * first ()
 reset iterator and return first item (or null if iter is empty)
 
Object * next ()
 advance and return next item (or null if no more to iterate)
 
Object * firstWithNumeric (Real *num=NULL)
 
Object * nextWithNumeric (Real *num=NULL)
 
void makeEmpty ()
 
void insert (Object *obj, Real numeric=0.0f)
 
void sort (IterOrderType order)
 
Int getCount ()
 
- 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
 

Detailed Description

A basic implementation of ObjectIterator, with (hidden) extensions to allow for sorting by a numeric field.

Definition at line 91 of file ObjectIter.h.

Constructor & Destructor Documentation

◆ SimpleObjectIterator()

SimpleObjectIterator::SimpleObjectIterator ( )

Definition at line 59 of file SimpleObjectIterator.cpp.

Member Function Documentation

◆ first()

Object * SimpleObjectIterator::first ( )
inlinevirtual

reset iterator and return first item (or null if iter is empty)

Implements ObjectIterator.

Definition at line 127 of file ObjectIter.h.

◆ firstWithNumeric()

Object * SimpleObjectIterator::firstWithNumeric ( Real * num = NULL)
inline

Definition at line 130 of file ObjectIter.h.

◆ getCount()

Int SimpleObjectIterator::getCount ( )
inline

return the total number of objects in the iterator.

Definition at line 156 of file ObjectIter.h.

◆ insert()

void SimpleObjectIterator::insert ( Object * obj,
Real numeric = 0.0f )

insert an object at the head of the iterator. the given numeric value (typically, dist-squared) is used only for subsequent sort() calls; if you aren't going to sort, pass 0.0f.

Definition at line 73 of file SimpleObjectIterator.cpp.

◆ makeEmpty()

void SimpleObjectIterator::makeEmpty ( )

throw away all contents of the iterator.

Definition at line 113 of file SimpleObjectIterator.cpp.

◆ next()

Object * SimpleObjectIterator::next ( )
inlinevirtual

advance and return next item (or null if no more to iterate)

Implements ObjectIterator.

Definition at line 128 of file ObjectIter.h.

◆ nextWithNumeric()

Object * SimpleObjectIterator::nextWithNumeric ( Real * num = NULL)

Definition at line 89 of file SimpleObjectIterator.cpp.

◆ sort()

void SimpleObjectIterator::sort ( IterOrderType order)

sort the iterator based on the numeric values for objects and the order given. Note that some orders (ITER_FASTEST) do nothing!

Definition at line 130 of file SimpleObjectIterator.cpp.


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