Base Framework
Public Types | Public Member Functions | List of all members
Enumerator< TRAITS > Class Template Referenceabstract

Enumeration interface for modifying access. More...

#include <base/collection/Enumeration.h>

Inherited by AllocatorEnumerator< TRAITS >, BitSet::BitSetEnumerator, DoubleLinkedNodeEnumerator< TRAITS >, DoubleLinkedNodeReadEnumerator< TRAITS >, HashTable< KEY, VALUE >::HashTableEnumerator< TRAITS >, HashTable< KEY, VALUE >::HashTableValueEnumerator< TRAITS >, InfixOrderEnumerator< TRAITS >, PostfixOrderEnumerator< TRAITS >, PrefixOrderEnumerator< TRAITS >, and Stack< TYPE >::StackReadEnumerator< TRAITS >.

Public Types

typedef TRAITS::Value Value
 
typedef TRAITS::Distance Distance
 
typedef TRAITS::Reference Reference
 
typedef TRAITS::Pointer Pointer
 

Public Member Functions

virtual bool hasNext () const noexcept=0
 
virtual Reference next ()=0
 
virtual ~Enumerator ()
 

Detailed Description

template<class TRAITS>
class Enumerator< TRAITS >

Enumeration interface for modifying access.

Enumeration interface used to traverse individual elements of a collection one by one. If possible, the enumeration interface should be used in preference to the iteration interface.

Version
1.0

Member Typedef Documentation

◆ Distance

template<class TRAITS >
typedef TRAITS::Distance Enumerator< TRAITS >::Distance

The type of the difference between elements.

◆ Pointer

template<class TRAITS >
typedef TRAITS::Pointer Enumerator< TRAITS >::Pointer

The type of a pointer to an element.

◆ Reference

template<class TRAITS >
typedef TRAITS::Reference Enumerator< TRAITS >::Reference

The type of a reference to an element.

◆ Value

template<class TRAITS >
typedef TRAITS::Value Enumerator< TRAITS >::Value

The type of the element.

Constructor & Destructor Documentation

◆ ~Enumerator()

template<class TRAITS >
virtual Enumerator< TRAITS >::~Enumerator ( )
inlinevirtual

Destroys the enumerator.

Member Function Documentation

◆ hasNext()

template<class TRAITS >
virtual bool Enumerator< TRAITS >::hasNext ( ) const
pure virtualnoexcept

◆ next()

template<class TRAITS >
virtual Reference Enumerator< TRAITS >::next ( )
pure virtual