EnumIterator< EnumType > Class Template Reference

#include <EnumIterator.h>

Inheritance diagram for EnumIterator< EnumType >:
Collaboration diagram for EnumIterator< EnumType >:

Public Member Functions

 EnumIterator (EnumType e)
 
EnumIteratoroperator++ ()
 
EnumIteratoroperator++ (int)
 
EnumIteratoroperator-- ()
 
EnumIteratoroperator-- (int)
 
bool operator== (const EnumIteratorBase &i) const
 
bool operator!= (const EnumIteratorBase &i) const
 
EnumType operator* () const
 

Protected Types

typedef int iterator_type
 

Protected Attributes

iterator_type current
 

Detailed Description

template<typename EnumType>
class EnumIterator< EnumType >

bidirectional iterator over an enum type

It can be instantiated using any enum (or C++11 strongly-typed enum) value; the most common expected use scenario has iterators emitted by EnumRange and WholeEnum via standard begin() and end() calls.

In order for the iterator to work, it is mandatory that the underlying enum type's representation values be sequential.

The iterator does not check for bounds when incrementing or decrementing, that responsibility is left to the caller.

See Also
EnumRange, WholeEnum, ReverseEnumIterator

Definition at line 65 of file EnumIterator.h.

Member Typedef Documentation

template<typename EnumType >
typedef int EnumIteratorBase< EnumType >::iterator_type
protectedinherited

Definition at line 29 of file EnumIterator.h.

Constructor & Destructor Documentation

template<typename EnumType >
EnumIterator< EnumType >::EnumIterator ( EnumType  e)
inlineexplicit

Definition at line 68 of file EnumIterator.h.

Member Function Documentation

template<typename EnumType >
bool EnumIteratorBase< EnumType >::operator!= ( const EnumIteratorBase< EnumType > &  i) const
inlineinherited

Definition at line 39 of file EnumIterator.h.

References EnumIteratorBase< EnumType >::current.

template<typename EnumType >
EnumType EnumIteratorBase< EnumType >::operator* ( ) const
inlineinherited

Definition at line 43 of file EnumIterator.h.

References EnumIteratorBase< EnumType >::current.

template<typename EnumType >
EnumIterator& EnumIterator< EnumType >::operator++ ( )
inline

Definition at line 70 of file EnumIterator.h.

template<typename EnumType >
EnumIterator& EnumIterator< EnumType >::operator++ ( int  )
inline

Definition at line 75 of file EnumIterator.h.

template<typename EnumType >
EnumIterator& EnumIterator< EnumType >::operator-- ( )
inline

Definition at line 81 of file EnumIterator.h.

template<typename EnumType >
EnumIterator& EnumIterator< EnumType >::operator-- ( int  )
inline

Definition at line 86 of file EnumIterator.h.

template<typename EnumType >
bool EnumIteratorBase< EnumType >::operator== ( const EnumIteratorBase< EnumType > &  i) const
inlineinherited

Definition at line 35 of file EnumIterator.h.

References EnumIteratorBase< EnumType >::current.

Member Data Documentation

template<typename EnumType >
iterator_type EnumIteratorBase< EnumType >::current
protectedinherited

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors