My Project  UNKNOWN_GIT_VERSION
Public Member Functions | Protected Member Functions | Private Member Functions
IBaseEnumerator Class Referenceabstract

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

Protected Member Functions

 IBaseEnumerator ()
 
 ~IBaseEnumerator ()
 

Private Member Functions

 IBaseEnumerator (const IBaseEnumerator &)
 disable copy constructor and assignment operator More...
 
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 useable here!
while( itr.MoveNext() )
{
do something custom with itr...
}

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 ( )
inlineprotected

Definition at line 65 of file Enumerator.h.

65 {}

◆ ~IBaseEnumerator()

IBaseEnumerator::~IBaseEnumerator ( )
inlineprotected

Definition at line 66 of file Enumerator.h.

66 {} // 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 CRecursivePolyCoeffsEnumerator< ConverterPolicy >, and CBasePolyEnumerator.

◆ 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 CRecursivePolyCoeffsEnumerator< ConverterPolicy >, and CBasePolyEnumerator.

◆ 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 CRecursivePolyCoeffsEnumerator< ConverterPolicy >, and CBasePolyEnumerator.


The documentation for this class was generated from the following file:
IBaseEnumerator::Reset
virtual void Reset()=0
Sets the enumerator to its initial position: -1, which is before the first element in the collection.
IBaseEnumerator
Definition: Enumerator.h:43
IBaseEnumerator::MoveNext
virtual bool MoveNext()=0
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...