My Project
Loading...
Searching...
No Matches
IEnumerator< T > Class Template Reference

Templated enumerator interface for simple iteration over a generic collection of T's. More...

#include <Enumerator.h>

Additional Inherited Members

- Public Types inherited from IAccessor< T >
typedef T value_type
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
- Public Member Functions inherited from IBaseEnumerator
virtual bool MoveNext ()=0
 Advances the enumerator to the next element of the collection. returns true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. More...
 
virtual void Reset ()=0
 Sets the enumerator to its initial position: -1, which is before the first element in the collection. More...
 
virtual bool IsValid () const =0
 Current position is inside the collection (not -1 or past the end) More...
 
- Public Member Functions inherited from IAccessor< T >
virtual reference Current ()=0
 Gets the current element in the collection (read and write). More...
 
virtual const_reference Current () const =0
 Gets the current element in the collection (read only). More...
 
- Protected Member Functions inherited from IBaseEnumerator
 IBaseEnumerator ()
 
 ~IBaseEnumerator ()
 
- Protected Member Functions inherited from IAccessor< T >
 IAccessor ()
 
 ~IAccessor ()
 

Detailed Description

template<typename T>
class IEnumerator< T >

Templated enumerator interface for simple iteration over a generic collection of T's.

Abstract API of enumerators for generic enumerable collections of standalone objects of type T. Inspired by IEnumerator from C#. Usage parrten can be as follows:

IEnumerator<T>& itr = ...;
itr.Reset(); // goes before the first element, thus no itr.Current() is available here!
while( itr.MoveNext() )
{
use/change itr.Current()...
}
virtual reference Current()=0
Gets the current element in the collection (read and write).
virtual void Reset()=0
Sets the enumerator to its initial position: -1, which is before the first element in the collection.
virtual bool MoveNext()=0
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...
Templated enumerator interface for simple iteration over a generic collection of T's.
Definition: Enumerator.h:125

T is the type of objects to enumerate, available via Current() method

See also
IBaseEnumerator

Definition at line 124 of file Enumerator.h.


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