Iterator_T Class

class Iterator_T

Template interface for an iterator. The iterator class supports iteration over any collection that supports the ICollection_T interface.

Defined in: Collect.h

Class Template Arguments

element_t

The class of the element to retrieve as the iterator advances.

Class Members

virtual BOOL Select()

Test whether the current element should be selected or skipped during traversal

virtual void First()

Moves the iterator to the first element in the collection

virtual void Next()

Moves the iterator to the next element in the collection

virtual BOOL FindNext(element_t elem)

Finds the next element equal to the specified after the current iterator position. If found, TRUE is returned and the iterator is moved.

virtual void Prev()

Moves the iterator to the previous element in the collection

virtual BOOL FindPrev(element_t elem)

Finds the previous element equal to the specified before the current iterator position. If found, TRUE is returned and the iterator is moved.

virtual void Last()

Moves the iterator to the last element in the collection

virtual element_t Get()

Retrieves a copy of the element at the current iterator position

inline element_t GetFirst()

Moves the iterator to and retrieves the first element in the collection

virtual element_t GetNext()

Moves the iterator to and retrieves the next element in the collection

virtual element_t GetPrev()

Moves the iterator to and retrieves the previous element in the collection

virtual element_t GetLast()

Moves the iterator to and retrieves the last element in the collection

virtual void Set(element_t elem)

Sets the element within the collection at the current iterator position

virtual void Remove()

Removes the element within the collection at the current iterator position

virtual element_t Insert(element_t elem)

Inserts the specified element into the collection at the current iterator position

virtual BOOL EOC()

Are we beyond the beginning or end of the collection

CMN_ITERATOR_CONST Iterator_T& operator++()

Advance iterator to next element

CMN_ITERATOR_CONST Iterator_T& operator--()

Move iterator to previous element

element_t& operator*()

Get the element at the current iterator position

CMN_ITERATOR_CONST element_t& operator*()

Get the element at the current iterator position