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_type & | reference
typedef const value_type & | const_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.
virtual void | Reset ()=0
| Sets the enumerator to its initial position: -1, which is before the first element in the collection.
virtual bool | IsValid () const =0
| Current position is inside the collection (not -1 or past the end).
Public Member Functions inherited from IAccessor< T >
virtual reference | Current ()=0
| Gets the current element in the collection (read and write).
virtual const_reference | Current () const =0
| Gets the current element in the collection (read only).
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()...
}
IAccessor::Current
virtual reference Current()=0
Gets the current element in the collection (read and write).
IBaseEnumerator::Reset
virtual void Reset()=0
Sets the enumerator to its initial position: -1, which is before the first element in the collection.
IBaseEnumerator::MoveNext
virtual bool MoveNext()=0
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...
IEnumerator
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:

- libpolys/coeffs/Enumerator.h