jaulib v1.3.6
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
jau::enums::enum_iterator< EnumType, Vargs > Class Template Reference

Enumeration iterator, see enum_info. More...

#include <enum_util.hpp>

Inheritance diagram for jau::enums::enum_iterator< EnumType, Vargs >:
Collaboration diagram for jau::enums::enum_iterator< EnumType, Vargs >:

Public Types

typedef enum_info_t::difference_type difference_type
 
typedef enum_info< EnumType, Vargs... > enum_info_t
 
typedef enum_info_t::iterator_base_t iterator_type
 enum_iterator to iterate over all enum values (const enum values)
 
typedef enum_info_t::pointer pointer
 pointer to value_type
 
typedef enum_info_t::reference reference
 reference to value_type
 
typedef enum_info_t::size_type size_type
 
typedef enum_info_t::value_type value_type
 enum value type, i.e. the enum type itself
 

Public Member Functions

constexpr enum_iterator (const enum_iterator &o) noexcept=default
 C++ named requirements: LegacyIterator: CopyConstructible.
 
constexpr enum_iterator (enum_iterator &&o) noexcept=default
 C++ named requirements: LegacyIterator: MoveConstructable.
 
constexpr iterator_type base () const noexcept
 Returns a copy of the underlying storage iterator.
 
constexpr int compare (const enum_iterator &rhs) const noexcept
 Returns signum or three-way comparison value.
 
const enum_info_tdescription () const noexcept
 
constexpr difference_type dist_begin () const noexcept
 Returns the distance to_begin() using zero as first index.
 
constexpr difference_type dist_end () const noexcept
 Returns the distance to_end() using zero as first index.
 
constexpr bool is_begin () const noexcept
 Returns true, if this iterator points to begin().
 
constexpr bool is_end () const noexcept
 Returns true, if this iterator points to end().
 
constexpr value_type operator* () const noexcept
 Dereferencing iterator to value_type reference.
 
constexpr enum_iterator operator+ (difference_type rhs) const noexcept
 Binary 'iterator + element_count'.
 
constexpr enum_iteratoroperator++ () noexcept
 Pre-increment; Well performing, return *this.
 
constexpr enum_iterator operator++ (int) noexcept
 Post-increment.
 
constexpr enum_iteratoroperator+= (difference_type i) noexcept
 Addition-assignment of 'element_count'; Returns *this.
 
constexpr difference_type operator- (const enum_iterator &rhs) const noexcept
 Binary 'iterator - iterator -> element_count'; Returns element_count of type difference_type.
 
constexpr enum_iterator operator- (difference_type rhs) const noexcept
 Binary 'iterator - element_count'.
 
constexpr enum_iteratoroperator-- () noexcept
 Pre-decrement; Well performing, return *this.
 
constexpr enum_iterator operator-- (int) noexcept
 Post-decrement.
 
constexpr enum_iteratoroperator-= (difference_type i) noexcept
 Subtraction-assignment of 'element_count'; Returns *this.
 
constexpr const pointer operator-> () const noexcept
 Pointer to member access.
 
std::strong_ordering operator<=> (const enum_iterator &rhs) const noexcept
 Three way std::strong_ordering comparison operator, C++20.
 
constexpr enum_iteratoroperator= (const enum_iterator &o) noexcept=default
 Assigns content of other mutable iterator to this one, if they are not identical.
 
constexpr enum_iteratoroperator= (enum_iterator &&o) noexcept=default
 Assigns identity of given mutable iterator, if they are not identical.
 
constexpr bool operator== (const enum_iterator &rhs) const noexcept
 Two way comparison operator, != is implicit, C++20.
 
constexpr value_type operator[] (difference_type i) const noexcept
 Subscript of 'element_index', returning immutable value_type.
 
void swap (enum_iterator &o) noexcept
 C++ named requirements: LegacyIterator: Swappable.
 
constexpr enum_iteratorto_begin () noexcept
 This iterator is set to the first element, begin().
 
constexpr enum_iteratorto_end () noexcept
 This iterator is set to the last element, end().
 

Friends

class enum_info< EnumType, Vargs... >
 

Detailed Description

template<typename EnumType, auto... Vargs>
class jau::enums::enum_iterator< EnumType, Vargs >

Enumeration iterator, see enum_info.

Definition at line 354 of file enum_util.hpp.

Member Typedef Documentation

◆ enum_info_t

template<typename EnumType, auto... Vargs>
typedef enum_info<EnumType, Vargs...> jau::enums::enum_iterator< EnumType, Vargs >::enum_info_t

Definition at line 356 of file enum_util.hpp.

◆ size_type

template<typename EnumType, auto... Vargs>
typedef enum_info_t::size_type jau::enums::enum_iterator< EnumType, Vargs >::size_type

Definition at line 358 of file enum_util.hpp.

◆ difference_type

template<typename EnumType, auto... Vargs>
typedef enum_info_t::difference_type jau::enums::enum_iterator< EnumType, Vargs >::difference_type

Definition at line 359 of file enum_util.hpp.

◆ value_type

template<typename EnumType, auto... Vargs>
typedef enum_info_t::value_type jau::enums::enum_iterator< EnumType, Vargs >::value_type

enum value type, i.e. the enum type itself

Definition at line 362 of file enum_util.hpp.

◆ pointer

template<typename EnumType, auto... Vargs>
typedef enum_info_t::pointer jau::enums::enum_iterator< EnumType, Vargs >::pointer

pointer to value_type

Definition at line 365 of file enum_util.hpp.

◆ reference

template<typename EnumType, auto... Vargs>
typedef enum_info_t::reference jau::enums::enum_iterator< EnumType, Vargs >::reference

reference to value_type

Definition at line 368 of file enum_util.hpp.

◆ iterator_type

template<typename EnumType, auto... Vargs>
typedef enum_info_t::iterator_base_t jau::enums::enum_iterator< EnumType, Vargs >::iterator_type

enum_iterator to iterate over all enum values (const enum values)

Definition at line 371 of file enum_util.hpp.

Constructor & Destructor Documentation

◆ enum_iterator() [1/2]

template<typename EnumType, auto... Vargs>
jau::enums::enum_iterator< EnumType, Vargs >::enum_iterator ( const enum_iterator< EnumType, Vargs > & o)
constexprdefaultnoexcept

C++ named requirements: LegacyIterator: CopyConstructible.

◆ enum_iterator() [2/2]

template<typename EnumType, auto... Vargs>
jau::enums::enum_iterator< EnumType, Vargs >::enum_iterator ( enum_iterator< EnumType, Vargs > && o)
constexprdefaultnoexcept

C++ named requirements: LegacyIterator: MoveConstructable.

Member Function Documentation

◆ operator=() [1/2]

template<typename EnumType, auto... Vargs>
enum_iterator & jau::enums::enum_iterator< EnumType, Vargs >::operator= ( const enum_iterator< EnumType, Vargs > & o)
constexprdefaultnoexcept

Assigns content of other mutable iterator to this one, if they are not identical.

C++ named requirements: LegacyIterator: CopyAssignable

Parameters
othe new identity value to be copied into this iterator
Returns
reference to this

◆ operator=() [2/2]

template<typename EnumType, auto... Vargs>
enum_iterator & jau::enums::enum_iterator< EnumType, Vargs >::operator= ( enum_iterator< EnumType, Vargs > && o)
constexprdefaultnoexcept

Assigns identity of given mutable iterator, if they are not identical.

C++ named requirements: LegacyIterator: MoveAssignable

Parameters
othe new identity to be taken
Returns
reference to this

◆ description()

template<typename EnumType, auto... Vargs>
const enum_info_t & jau::enums::enum_iterator< EnumType, Vargs >::description ( ) const
inlinenoexcept

Definition at line 416 of file enum_util.hpp.

◆ swap()

template<typename EnumType, auto... Vargs>
void jau::enums::enum_iterator< EnumType, Vargs >::swap ( enum_iterator< EnumType, Vargs > & o)
inlinenoexcept

C++ named requirements: LegacyIterator: Swappable.

Definition at line 421 of file enum_util.hpp.

◆ dist_end()

template<typename EnumType, auto... Vargs>
difference_type jau::enums::enum_iterator< EnumType, Vargs >::dist_end ( ) const
inlineconstexprnoexcept

Returns the distance to_end() using zero as first index.

A.k.a the remaining elements iterable.

Definition at line 429 of file enum_util.hpp.

◆ is_end()

template<typename EnumType, auto... Vargs>
bool jau::enums::enum_iterator< EnumType, Vargs >::is_end ( ) const
inlineconstexprnoexcept

Returns true, if this iterator points to end().

Definition at line 434 of file enum_util.hpp.

◆ to_end()

template<typename EnumType, auto... Vargs>
enum_iterator & jau::enums::enum_iterator< EnumType, Vargs >::to_end ( )
inlineconstexprnoexcept

This iterator is set to the last element, end().

Returns *this;

Definition at line 439 of file enum_util.hpp.

◆ dist_begin()

template<typename EnumType, auto... Vargs>
difference_type jau::enums::enum_iterator< EnumType, Vargs >::dist_begin ( ) const
inlineconstexprnoexcept

Returns the distance to_begin() using zero as first index.

A.k.a the index from start.

Definition at line 445 of file enum_util.hpp.

◆ is_begin()

template<typename EnumType, auto... Vargs>
bool jau::enums::enum_iterator< EnumType, Vargs >::is_begin ( ) const
inlineconstexprnoexcept

Returns true, if this iterator points to begin().

Definition at line 450 of file enum_util.hpp.

◆ to_begin()

template<typename EnumType, auto... Vargs>
enum_iterator & jau::enums::enum_iterator< EnumType, Vargs >::to_begin ( )
inlineconstexprnoexcept

This iterator is set to the first element, begin().

Returns *this;

Definition at line 455 of file enum_util.hpp.

◆ base()

template<typename EnumType, auto... Vargs>
iterator_type jau::enums::enum_iterator< EnumType, Vargs >::base ( ) const
inlineconstexprnoexcept

Returns a copy of the underlying storage iterator.

Definition at line 461 of file enum_util.hpp.

◆ compare()

template<typename EnumType, auto... Vargs>
int jau::enums::enum_iterator< EnumType, Vargs >::compare ( const enum_iterator< EnumType, Vargs > & rhs) const
inlineconstexprnoexcept

Returns signum or three-way comparison value.

   0 if equal (both, store and iteratore),
  -1 if this->iterator_ < rhs_iter and
   1 if this->iterator_ > rhs_iter (otherwise)
Parameters
rhs_storeright-hand side store
rhs_iterright-hand side iterator

Definition at line 475 of file enum_util.hpp.

◆ operator==()

template<typename EnumType, auto... Vargs>
bool jau::enums::enum_iterator< EnumType, Vargs >::operator== ( const enum_iterator< EnumType, Vargs > & rhs) const
inlineconstexprnoexcept

Two way comparison operator, != is implicit, C++20.

Definition at line 481 of file enum_util.hpp.

◆ operator<=>()

template<typename EnumType, auto... Vargs>
std::strong_ordering jau::enums::enum_iterator< EnumType, Vargs >::operator<=> ( const enum_iterator< EnumType, Vargs > & rhs) const
inlinenoexcept

Three way std::strong_ordering comparison operator, C++20.

Definition at line 485 of file enum_util.hpp.

◆ operator*()

template<typename EnumType, auto... Vargs>
value_type jau::enums::enum_iterator< EnumType, Vargs >::operator* ( ) const
inlineconstexprnoexcept

Dereferencing iterator to value_type reference.

Returns
immutable reference to value_type

Definition at line 496 of file enum_util.hpp.

◆ operator->()

template<typename EnumType, auto... Vargs>
const pointer jau::enums::enum_iterator< EnumType, Vargs >::operator-> ( ) const
inlineconstexprnoexcept

Pointer to member access.

Returns
immutable pointer to value_type

Definition at line 504 of file enum_util.hpp.

◆ operator++() [1/2]

template<typename EnumType, auto... Vargs>
enum_iterator & jau::enums::enum_iterator< EnumType, Vargs >::operator++ ( )
inlineconstexprnoexcept

Pre-increment; Well performing, return *this.

Definition at line 509 of file enum_util.hpp.

◆ operator++() [2/2]

template<typename EnumType, auto... Vargs>
enum_iterator jau::enums::enum_iterator< EnumType, Vargs >::operator++ ( int )
inlineconstexprnoexcept

Post-increment.

Definition at line 515 of file enum_util.hpp.

◆ operator--() [1/2]

template<typename EnumType, auto... Vargs>
enum_iterator & jau::enums::enum_iterator< EnumType, Vargs >::operator-- ( )
inlineconstexprnoexcept

Pre-decrement; Well performing, return *this.

Definition at line 521 of file enum_util.hpp.

◆ operator--() [2/2]

template<typename EnumType, auto... Vargs>
enum_iterator jau::enums::enum_iterator< EnumType, Vargs >::operator-- ( int )
inlineconstexprnoexcept

Post-decrement.

Definition at line 527 of file enum_util.hpp.

◆ operator[]()

template<typename EnumType, auto... Vargs>
value_type jau::enums::enum_iterator< EnumType, Vargs >::operator[] ( difference_type i) const
inlineconstexprnoexcept

Subscript of 'element_index', returning immutable value_type.

Definition at line 533 of file enum_util.hpp.

◆ operator+=()

template<typename EnumType, auto... Vargs>
enum_iterator & jau::enums::enum_iterator< EnumType, Vargs >::operator+= ( difference_type i)
inlineconstexprnoexcept

Addition-assignment of 'element_count'; Returns *this.

Definition at line 537 of file enum_util.hpp.

◆ operator+()

template<typename EnumType, auto... Vargs>
enum_iterator jau::enums::enum_iterator< EnumType, Vargs >::operator+ ( difference_type rhs) const
inlineconstexprnoexcept

Binary 'iterator + element_count'.

Definition at line 541 of file enum_util.hpp.

◆ operator-=()

template<typename EnumType, auto... Vargs>
enum_iterator & jau::enums::enum_iterator< EnumType, Vargs >::operator-= ( difference_type i)
inlineconstexprnoexcept

Subtraction-assignment of 'element_count'; Returns *this.

Definition at line 545 of file enum_util.hpp.

◆ operator-() [1/2]

template<typename EnumType, auto... Vargs>
enum_iterator jau::enums::enum_iterator< EnumType, Vargs >::operator- ( difference_type rhs) const
inlineconstexprnoexcept

Binary 'iterator - element_count'.

Definition at line 549 of file enum_util.hpp.

◆ operator-() [2/2]

template<typename EnumType, auto... Vargs>
difference_type jau::enums::enum_iterator< EnumType, Vargs >::operator- ( const enum_iterator< EnumType, Vargs > & rhs) const
inlineconstexprnoexcept

Binary 'iterator - iterator -> element_count'; Returns element_count of type difference_type.

Definition at line 555 of file enum_util.hpp.

Friends And Related Symbol Documentation

◆ enum_info< EnumType, Vargs... >

template<typename EnumType, auto... Vargs>
friend class enum_info< EnumType, Vargs... >
friend

Definition at line 375 of file enum_util.hpp.


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