ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
EnumRecords< TEnum, TEnableIf >::ForwardIterator Struct Reference

Description:

template<typename TEnum, typename TEnableIf>
struct alib::enums::EnumRecords< TEnum, TEnableIf >::ForwardIterator

Implementation of std::iterator_traits for enum records. Begin- and end-iterators can be received with static methods EnumRecords::begin and EnumRecords::end. In ranged base for(:) loops, a local instance of type EnumRecords has to be created.

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

Definition at line 304 of file records.hpp.

#include <records.hpp>

Public Method Index:

TEnum Enum () const
 
TIntegral Integral () const
 
bool operator!= (ForwardIterator other) const
 
const TRecordoperator* () const
 
ForwardIteratoroperator++ ()
 
ForwardIterator operator++ (int)
 
TRecord const * operator-> () const
 
bool operator== (ForwardIterator other) const
 

Private Type Index:

using difference_type = integer
 Implementation of std::iterator_traits.
 
using iterator_category = std::forward_iterator_tag
 Implementation of std::iterator_traits.
 
using Node = typename detail::EnumRecordHook<TEnum>::Node
 Shortcut to the record hook's inner node type (linked list).
 
using pointer = TRecord const*
 Implementation of std::iterator_traits.
 
using reference = const TRecord&
 Implementation of std::iterator_traits.
 
using value_type = const TRecord&
 Implementation of std::iterator_traits.
 

Private Field Index:

Nodenode
 The current node this iterator refers to.
 

Private Method Index:

 ForwardIterator (Node *start) noexcept
 

Type Definition Details:

◆ difference_type

template<typename TEnum , typename TEnableIf >
using difference_type = integer
private

Implementation of std::iterator_traits.

Definition at line 326 of file records.hpp.

◆ iterator_category

template<typename TEnum , typename TEnableIf >
using iterator_category = std::forward_iterator_tag
private

Implementation of std::iterator_traits.

Definition at line 324 of file records.hpp.

◆ Node

template<typename TEnum , typename TEnableIf >
using Node = typename detail::EnumRecordHook<TEnum>::Node
private

Shortcut to the record hook's inner node type (linked list).

Definition at line 313 of file records.hpp.

◆ pointer

template<typename TEnum , typename TEnableIf >
using pointer = TRecord const*
private

Implementation of std::iterator_traits.

Definition at line 327 of file records.hpp.

◆ reference

template<typename TEnum , typename TEnableIf >
using reference = const TRecord&
private

Implementation of std::iterator_traits.

Definition at line 328 of file records.hpp.

◆ value_type

template<typename TEnum , typename TEnableIf >
using value_type = const TRecord&
private

Implementation of std::iterator_traits.

Definition at line 325 of file records.hpp.

Field Details:

◆ node

template<typename TEnum , typename TEnableIf >
Node* node
private

The current node this iterator refers to.

Definition at line 316 of file records.hpp.

Constructor(s) / Destructor Details:

◆ ForwardIterator()

template<typename TEnum , typename TEnableIf >
ForwardIterator ( Node * start)
inlineprivatenoexcept

Constructor.

Parameters
startPointer to the initial element.

Definition at line 320 of file records.hpp.

Method Details:

◆ Enum()

template<typename TEnum , typename TEnableIf >
TEnum Enum ( ) const
inline

Returns the enum element of the enum record that this iterator refers to.

Returns
The enum element the current record is associated to.

Definition at line 370 of file records.hpp.

◆ Integral()

template<typename TEnum , typename TEnableIf >
TIntegral Integral ( ) const
inline

Returns the underlying integral value of the enum element of the enum record that this iterator refers to.

Returns
The integral value of the enum element the current record is associated to.

Definition at line 379 of file records.hpp.

◆ operator!=()

template<typename TEnum , typename TEnableIf >
bool operator!= ( ForwardIterator other) const
inline

Comparison operator.

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

Definition at line 361 of file records.hpp.

◆ operator*()

template<typename TEnum , typename TEnableIf >
const TRecord & operator* ( ) const
inline

Returns a constant reference to the enum record this iterator refers to.

Returns
The current enum record.

Definition at line 386 of file records.hpp.

◆ operator++() [1/2]

template<typename TEnum , typename TEnableIf >
ForwardIterator & operator++ ( )
inline

Prefix increment operator.

Returns
A reference to this object.

Definition at line 336 of file records.hpp.

◆ operator++() [2/2]

template<typename TEnum , typename TEnableIf >
ForwardIterator operator++ ( int )
inline

Postfix increment operator.

Returns
An iterator value that is not increased, yet.

Definition at line 344 of file records.hpp.

Here is the call graph for this function:

◆ operator->()

template<typename TEnum , typename TEnableIf >
TRecord const * operator-> ( ) const
inline

Returns a constant pointer to the enum record this iterator refers to.

Returns
The current enum record.

Definition at line 393 of file records.hpp.

◆ operator==()

template<typename TEnum , typename TEnableIf >
bool operator== ( ForwardIterator other) const
inline

Comparison operator.

Parameters
otherThe iterator to compare ourselves to.
Returns
true if this and the given iterator are pointing to the same element, false otherwise.

Definition at line 353 of file records.hpp.


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