Loading...
Searching...
No Matches
IBaseEnumerator Class Referenceabstract

Base enumerator interface for simple iteration over a generic collection. More...

`#include <Enumerator.h>`

## Public Member Functions

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).

## Protected Member Functions

| IBaseEnumerator ()
| ~IBaseEnumerator ()

## Private Member Functions

| IBaseEnumerator (const IBaseEnumerator &)
| disable copy constructor and assignment operator
void | operator= (const IBaseEnumerator &)

## Detailed Description

Base enumerator interface for simple iteration over a generic collection.

Abstract API of enumerators for enumerable collections of standalone objects. Just like IEnumerator from C#. Usage pattern can be as follows:

IBaseEnumerator& itr = ...;
itr.Reset(); // goes to the "-1" element
// NOTE: itr is not usable here!
while( itr.MoveNext() )
{
do something custom with itr...
}
IBaseEnumerator::IBaseEnumerator
IBaseEnumerator(const IBaseEnumerator &)
disable copy constructor and assignment operator
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...

Note that the Reset()

See also
  IEnumerator

Definition at line 43 of file Enumerator.h.

## Constructor & Destructor Documentation

## IBaseEnumerator() [1/2]

IBaseEnumerator::IBaseEnumerator | ( | const IBaseEnumerator & |  | ) |

private

disable copy constructor and assignment operator

## IBaseEnumerator() [2/2]

IBaseEnumerator::IBaseEnumerator | ( |  | ) |

inline protected

Definition at line 65 of file Enumerator.h.

{}

## ~IBaseEnumerator()

IBaseEnumerator::~IBaseEnumerator | ( |  | ) |

inline protected

Definition at line 66 of file Enumerator.h.

{} // TODO: needed?

## Member Function Documentation

## IsValid()

virtual bool IBaseEnumerator::IsValid | ( |  | ) | const

pure virtual

Current position is inside the collection (not -1 or past the end).

Implemented in CBasePolyEnumerator, and CRecursivePolyCoeffsEnumerator< ConverterPolicy >.

## MoveNext()

virtual bool IBaseEnumerator::MoveNext | ( |  | ) |

pure virtual

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.

Implemented in CBasePolyEnumerator, and CRecursivePolyCoeffsEnumerator< ConverterPolicy >.

## operator=()

void IBaseEnumerator::operator= | ( | const IBaseEnumerator & |  | ) |

private

## Reset()

virtual void IBaseEnumerator::Reset | ( |  | ) |

pure virtual

Sets the enumerator to its initial position: -1, which is before the first element in the collection.

Implemented in CBasePolyEnumerator, and CRecursivePolyCoeffsEnumerator< ConverterPolicy >.

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

- libpolys/coeffs/Enumerator.h