Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/iter-cursor.hpp"
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 iter-adapter.hppLumiera Forward Iterator"" concept, i.e. it can be iterated until exhaustion, in which case it will evaluate to bool(false).
Definition at line 166 of file iter-cursor.hpp.
Public Member Functions | |
IterCursor (IterCursor &&)=default | |
IterCursor (IterCursor const &)=default | |
template<class CON > | |
IterCursor (CON &container) | |
IterCursor (IT &&begin, IT &&end) | |
IterCursor & | operator= (IterCursor &&)=default |
IterCursor & | operator= (IterCursor const &)=default |
IterCursor & | switchBackwards () |
IterCursor & | switchDir () |
change the orientation of iteration. More... | |
IterCursor & | switchForwards () |
Public Member Functions inherited from IterStateWrapper< iter::CursorGear< IT >::value_type, iter::CursorGear< IT > > | |
IterStateWrapper (iter::CursorGear< IT > &&initialState) | |
IterStateWrapper (iter::CursorGear< IT > const &initialState) | |
bool | empty () const |
ENABLE_USE_IN_STD_RANGE_FOR_LOOPS (IterStateWrapper) | |
bool | isValid () const |
operator bool () const | |
reference | operator* () const |
IterStateWrapper & | operator++ () |
pointer | operator-> () const |
Private Types | |
using | _Core = iter::CursorGear< IT > |
using | _Parent = IterStateWrapper< typename _Core::value_type, _Core > |
Additional Inherited Members | |
Public Types inherited from IterStateWrapper< iter::CursorGear< IT >::value_type, iter::CursorGear< IT > > | |
typedef iter::CursorGear< IT >::value_type * | pointer |
typedef iter::CursorGear< IT >::value_type & | reference |
typedef iter::CursorGear< IT >::value_type | value_type |
Protected Member Functions inherited from IterStateWrapper< iter::CursorGear< IT >::value_type, iter::CursorGear< IT > > | |
void | __throw_if_empty () const |
iter::CursorGear< IT > & | stateCore () |
allow derived classes to access state representation | |
iter::CursorGear< IT > const & | stateCore () const |
|
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 199 of file iter-cursor.hpp.