Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
LinkedElements< N, ALO >::IterationState Struct Reference

Description

template<class N, class ALO = linked_elements::OwningHeapAllocated<N>>
struct lib::LinkedElements< N, ALO >::IterationState

Iteration is just following the single linked list.

We encapsulate this simple pointer into a dedicated marker type to ease the handling and mixing of iterators and const iterators. (Explanation: IterationState depends on our type parameters...)

Definition at line 354 of file linked-elements.hpp.

Public Attributes

N * node
 

Public Member Functions

 IterationState (N *p=nullptr)
 
void iterNext ()
 Iteration-logic: switch to next position.
 
bool checkPoint () const
 Iteration-logic: detect iteration end.
 
N & yield () const
 

Friends

bool operator== (IterationState const &il, IterationState const &ir)
 

Constructor & Destructor Documentation

◆ IterationState()

template<class N , class ALO = linked_elements::OwningHeapAllocated<N>>
IterationState ( N *  p = nullptr)
inline

Definition at line 358 of file linked-elements.hpp.

Member Function Documentation

◆ iterNext()

template<class N , class ALO = linked_elements::OwningHeapAllocated<N>>
void iterNext ( )
inline

Iteration-logic: switch to next position.

Warning
assuming the given node pointer belongs to this collection. actually this is never checked; also the given node might have been deallocated in the meantime.

Definition at line 370 of file linked-elements.hpp.

References LinkedElements< N, ALO >::IterationState::node.

◆ checkPoint()

template<class N , class ALO = linked_elements::OwningHeapAllocated<N>>
bool checkPoint ( ) const
inline

Iteration-logic: detect iteration end.

Definition at line 377 of file linked-elements.hpp.

References LinkedElements< N, ALO >::IterationState::node.

◆ yield()

template<class N , class ALO = linked_elements::OwningHeapAllocated<N>>
N & yield ( ) const
inline

Member Data Documentation

◆ node

template<class N , class ALO = linked_elements::OwningHeapAllocated<N>>
N* node

Friends And Related Symbol Documentation

◆ operator==

template<class N , class ALO = linked_elements::OwningHeapAllocated<N>>
bool operator== ( IterationState const &  il,
IterationState const &  ir 
)
friend

Definition at line 390 of file linked-elements.hpp.

+ Collaboration diagram for LinkedElements< N, ALO >::IterationState:

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