My Project
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions
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. 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...
}
Base enumerator interface for simple iteration over a generic collection.
Definition: Enumerator.h:44
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...

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 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: