Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
IterCursor< IT > Class Template Reference

#include "lib/iter-cursor.hpp"

Description

template<class IT>
class lib::IterCursor< IT >

A cursor-like iterator with the ability to switch iteration direction.

It can be built on top of any bidirectional STL iterator or similar entity, which has an -- operator. Initially, IterCursor will operate in forward direction; irrespective of the current direction, it always fulfils the "Lumiera Forward Iterator" concept, i.e. it can be iterated until exhaustion, in which case it will evaluate to bool(false).

Note
IterCursor instances can be equality compared, also taking the current direction into account. As a special case, all exhausted iterators are treated as equal.

Definition at line 157 of file iter-cursor.hpp.

Public Member Functions

 IterCursor ()=default
 
 IterCursor (IterCursor &&)=default
 
 IterCursor (IterCursor const &)=default
 
IterCursoroperator= (IterCursor &&)=default
 
IterCursoroperator= (IterCursor const &)=default
 
template<class CON >
 IterCursor (CON &container)
 
 IterCursor (IT &&begin, IT &&end)
 
IterCursorswitchDir ()
 change the orientation of iteration.
 
IterCursorswitchForwards ()
 
IterCursorswitchBackwards ()
 
- Public Member Functions inherited from IterStateWrapper< iter::CursorGear< IT > >
 IterStateWrapper (iter::CursorGear< IT > &&initialState)
 
 IterStateWrapper (iter::CursorGear< IT > const &initialState)
 
 IterStateWrapper ()
 
 operator bool () const
 
iter::CoreYield< iter::CursorGear< IT > > operator* () const
 
pointer operator-> () const
 
IterStateWrapperoperator++ ()
 
bool isValid () const
 
bool empty () const
 
 ENABLE_USE_IN_STD_RANGE_FOR_LOOPS (IterStateWrapper)
 

Private Types

using _Core = iter::CursorGear< IT >
 
using _Parent = IterStateWrapper< _Core >
 

Additional Inherited Members

- Public Types inherited from IterStateWrapper< iter::CursorGear< IT > >
using value_type = meta::RefTraits< iter::CoreYield< iter::CursorGear< IT > > >::Value
 
using reference = meta::RefTraits< iter::CoreYield< iter::CursorGear< IT > > >::Reference
 
using pointer = meta::RefTraits< iter::CoreYield< iter::CursorGear< IT > > >::Pointer
 
- Protected Member Functions inherited from IterStateWrapper< iter::CursorGear< IT > >
iter::CursorGear< IT > & stateCore ()
 allow derived classes to access state representation
 
iter::CursorGear< IT > const & stateCore () const
 
void __throw_if_empty () const
 

Constructor & Destructor Documentation

◆ IterCursor() [1/5]

template<class IT >
IterCursor ( )
default

◆ IterCursor() [2/5]

template<class IT >
IterCursor ( IterCursor< IT > &&  )
default

◆ IterCursor() [3/5]

template<class IT >
IterCursor ( IterCursor< IT > const &  )
default

◆ IterCursor() [4/5]

template<class IT >
template<class CON >
IterCursor ( CON &  container)
inlineexplicit

Definition at line 173 of file iter-cursor.hpp.

◆ IterCursor() [5/5]

template<class IT >
IterCursor ( IT &&  begin,
IT &&  end 
)
inline

Definition at line 177 of file iter-cursor.hpp.

Member Typedef Documentation

◆ _Core

template<class IT >
using _Core = iter::CursorGear<IT>
private

Definition at line 160 of file iter-cursor.hpp.

◆ _Parent

template<class IT >
using _Parent = IterStateWrapper<_Core>
private

Definition at line 161 of file iter-cursor.hpp.

Member Function Documentation

◆ operator=() [1/2]

template<class IT >
IterCursor & operator= ( IterCursor< IT > &&  )
default

◆ operator=() [2/2]

template<class IT >
IterCursor & operator= ( IterCursor< IT > const &  )
default

◆ switchDir()

template<class IT >
IterCursor & switchDir ( )
inline

change the orientation of iteration.

A forward oriented iteration will continue backwards, and vice versa. This operation can even be invoked on an already exhausted iterator, in which case it will turn back in reversed direction.

Definition at line 190 of file iter-cursor.hpp.

References IterStateWrapper< iter::CursorGear< IT > >::stateCore().

+ Here is the call graph for this function:

◆ switchForwards()

template<class IT >
IterCursor & switchForwards ( )
inline

Definition at line 197 of file iter-cursor.hpp.

References IterStateWrapper< iter::CursorGear< IT > >::stateCore().

+ Here is the call graph for this function:

◆ switchBackwards()

template<class IT >
IterCursor & switchBackwards ( )
inline

Definition at line 204 of file iter-cursor.hpp.

References IterStateWrapper< iter::CursorGear< IT > >::stateCore().

+ Here is the call graph for this function:
+ Inheritance diagram for IterCursor< IT >:
+ Collaboration diagram for IterCursor< IT >:

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