ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
EnumIterator< TEnum, TEnableIf >::TRandomAccessIterator< TPointer, TReference > Class Template Reference

Description:

template<typename TEnum, typename TEnableIf>
template<typename TPointer, typename TReference>
class alib::enums::EnumIterator< TEnum, TEnableIf >::TRandomAccessIterator< TPointer, TReference >

Implementation of std::iterator_traits for enum type TEnum . This class exposes ConstIterator which uses const TEnum* and const TEnum& as pointer and reference types.

As the name of the class indicates, this iterator satisfies the C++ standard library concept RandomAccessIterator .

Definition at line 235 of file iterable.hpp.

#include <iterable.hpp>

Public Method Index:

constexpr TRandomAccessIterator (TEnum _p=TEnum(0))
 
constexpr bool operator!= (TRandomAccessIterator other) const
 
constexpr TEnum operator* () const
 
TRandomAccessIterator operator+ (TIntegral n) const
 
TRandomAccessIteratoroperator++ ()
 
TRandomAccessIterator operator++ (int)
 
TRandomAccessIteratoroperator+= (TIntegral n)
 
TRandomAccessIterator operator- (TIntegral n) const
 
std::ptrdiff_t operator- (TRandomAccessIterator other) const
 
TRandomAccessIteratoroperator-- ()
 
TRandomAccessIterator operator-- (int)
 
TRandomAccessIteratoroperator-= (TIntegral n)
 
bool operator< (TRandomAccessIterator other) const
 
bool operator<= (TRandomAccessIterator other) const
 
constexpr bool operator== (TRandomAccessIterator other) const
 
bool operator> (TRandomAccessIterator other) const
 
bool operator>= (TRandomAccessIterator other) const
 
TEnum operator[] (std::ptrdiff_t n) const
 

Type Definition Details:

◆ difference_type

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
using difference_type = std::ptrdiff_t
private

Implementation of std::iterator_traits.

Definition at line 239 of file iterable.hpp.

◆ iterator_category

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
using iterator_category = std::random_access_iterator_tag
private

Implementation of std::iterator_traits.

Definition at line 237 of file iterable.hpp.

◆ pointer

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
using pointer = TPointer
private

Implementation of std::iterator_traits.

Definition at line 240 of file iterable.hpp.

◆ reference

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
using reference = TReference
private

Implementation of std::iterator_traits.

Definition at line 241 of file iterable.hpp.

◆ TIntegral

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
using TIntegral = typename std::underlying_type<TEnum>::type
protected

The underlying integer type.

Definition at line 248 of file iterable.hpp.

◆ value_type

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
using value_type = TEnum
private

Implementation of std::iterator_traits.

Definition at line 238 of file iterable.hpp.

Field Details:

◆ p

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
TEnum p
protected

The actual enum element.

Definition at line 245 of file iterable.hpp.

Constructor(s) / Destructor Details::

◆ TRandomAccessIterator()

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
constexpr TRandomAccessIterator ( TEnum _p = TEnum(0))
inlineexplicitconstexpr

Constructor.

Parameters
_pOur initial value

Definition at line 255 of file iterable.hpp.

Method Details:

◆ operator!=()

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
constexpr bool operator!= ( TRandomAccessIterator< TPointer, TReference > other) const
inlineconstexpr

Comparison operator.

Parameters
otherThe iterator to compare ourselves to.
Returns
true if this and given iterator are not equal, false otherwise.

Definition at line 296 of file iterable.hpp.

◆ operator*()

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
constexpr TEnum operator* ( ) const
inlineconstexpr

Retrieves the enum element that this iterator references.

Returns
The enum element.

Definition at line 304 of file iterable.hpp.

◆ operator+()

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
TRandomAccessIterator operator+ ( TIntegral n) const
inline

Addition.

Parameters
nThe value to subtract.
Returns
A reference to the new iterator.

Definition at line 363 of file iterable.hpp.

Here is the call graph for this function:

◆ operator++() [1/2]

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
TRandomAccessIterator & operator++ ( )
inline

Prefix increment operator.

Returns
A reference to ourselves.

Definition at line 263 of file iterable.hpp.

Here is the call graph for this function:

◆ operator++() [2/2]

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
TRandomAccessIterator operator++ ( int )
inline

Postfix increment operator.

Returns
A reference to ourselves.

Definition at line 275 of file iterable.hpp.

Here is the call graph for this function:

◆ operator+=()

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
TRandomAccessIterator & operator+= ( TIntegral n)
inline

Addition assignment.

Parameters
nThe value to subtract.
Returns
A reference to ourselves.

Definition at line 340 of file iterable.hpp.

Here is the call graph for this function:

◆ operator-() [1/2]

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
TRandomAccessIterator operator- ( TIntegral n) const
inline

Subtraction.

Parameters
nThe value to subtract.
Returns
A reference to the new iterator.

Definition at line 374 of file iterable.hpp.

Here is the call graph for this function:

◆ operator-() [2/2]

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
std::ptrdiff_t operator- ( TRandomAccessIterator< TPointer, TReference > other) const
inline

Difference (distance) from this iterator to the given one.

Parameters
otherThe iterator to subtract
Returns
The iterator to subtract.

Definition at line 385 of file iterable.hpp.

Here is the call graph for this function:

◆ operator--() [1/2]

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
TRandomAccessIterator & operator-- ( )
inline

Prefix decrement operator.

Returns
A reference to ourselves.

Definition at line 314 of file iterable.hpp.

◆ operator--() [2/2]

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
TRandomAccessIterator operator-- ( int )
inline

Postfix decrement operator.

Returns
An iterator that with the old value.

Definition at line 326 of file iterable.hpp.

Here is the call graph for this function:

◆ operator-=()

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
TRandomAccessIterator & operator-= ( TIntegral n)
inline

Subtraction assignment.

Parameters
nThe value to subtract.
Returns
A reference to ourselves.

Definition at line 352 of file iterable.hpp.

Here is the call graph for this function:

◆ operator<()

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
bool operator< ( TRandomAccessIterator< TPointer, TReference > other) const
inline

Compares this iterator with the given one.

Parameters
otherThe iterator to compare
Returns
true if this iterator is smaller than other , false otherwise.

Definition at line 412 of file iterable.hpp.

◆ operator<=()

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
bool operator<= ( TRandomAccessIterator< TPointer, TReference > other) const
inline

Compares this iterator with the given one.

Parameters
otherThe iterator to compare
Returns
true if this iterator is smaller than or equal to other , false otherwise.

Definition at line 421 of file iterable.hpp.

◆ operator==()

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
constexpr bool operator== ( TRandomAccessIterator< TPointer, TReference > other) const
inlineconstexpr

Comparison operator.

Parameters
otherThe iterator to compare ourselves to.
Returns
true if this and given iterator are equal, false otherwise.

Definition at line 287 of file iterable.hpp.

◆ operator>()

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
bool operator> ( TRandomAccessIterator< TPointer, TReference > other) const
inline

Compares this iterator with the given one.

Parameters
otherThe iterator to compare
Returns
true if this iterator is greater than other , false otherwise.

Definition at line 431 of file iterable.hpp.

◆ operator>=()

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
bool operator>= ( TRandomAccessIterator< TPointer, TReference > other) const
inline

Compares this iterator with the given one.

Parameters
otherThe iterator to compare
Returns
true if this iterator is greater than or equal to other , false otherwise.

Definition at line 440 of file iterable.hpp.

◆ operator[]()

template<typename TEnum , typename TEnableIf >
template<typename TPointer , typename TReference >
TEnum operator[] ( std::ptrdiff_t n) const
inline

Subscript operator.

Parameters
nThe iterator to subtract
Returns
*( (*this) + n ).

Definition at line 398 of file iterable.hpp.

Here is the call graph for this function:

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