Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
IndexIter< CON, PTR > Class Template Reference

#include "lib/index-iter.hpp"

Description

template<class CON, typename PTR = CON*>
class lib::IndexIter< CON, PTR >

Subscript-index based access to a container, packaged as iterator.

This is a copyable and assignable value object (handle), referring to some data container maintained elsewhere. The container must provide an operator[]. This handle can be used as »Lumiera Forward Iterator«, but with the additional capability to retrieve and re-set the current index position.

Template Parameters
CONa container with operator[] and a function size()
PTRhow to refer to this container; can be defined as smart-ptr, additionally allowing to manage this container automatically.
Remarks
while a default constructed IndexIter and some exhausted IndexIter compare equal, only the latter can be re-set into active state.

Definition at line 112 of file index-iter.hpp.

Public Member Functions

 IndexIter ()=default
 
 IndexIter (CON &container)
 
 IndexIter (PTR pContainer)
 
size_t getIDX () const
 
void setIDX (size_t newIDX)
 
- Public Member Functions inherited from IterStateWrapper< ST, T >
 IterStateWrapper (ST &&initialState)
 
 IterStateWrapper (ST const &initialState)
 
 IterStateWrapper ()
 
 operator bool () const
 
operator* () const
 
pointer operator-> () const
 
IterStateWrapperoperator++ ()
 
bool isValid () const
 
bool empty () const
 
 ENABLE_USE_IN_STD_RANGE_FOR_LOOPS (IterStateWrapper)
 

Private Types

using _Cor = iter::IndexAccessCore< PTR >
 
using _Par = _Cor::IterWrapper
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ IndexIter() [1/3]

template<class CON , typename PTR = CON*>
IndexIter ( )
default

◆ IndexIter() [2/3]

template<class CON , typename PTR = CON*>
IndexIter ( CON &  container)
inline

Definition at line 120 of file index-iter.hpp.

◆ IndexIter() [3/3]

template<class CON , typename PTR = CON*>
IndexIter ( PTR  pContainer)
inline

Definition at line 121 of file index-iter.hpp.

Member Typedef Documentation

◆ _Cor

template<class CON , typename PTR = CON*>
using _Cor = iter::IndexAccessCore<PTR>
private

Definition at line 115 of file index-iter.hpp.

◆ _Par

template<class CON , typename PTR = CON*>
using _Par = _Cor::IterWrapper
private

Definition at line 116 of file index-iter.hpp.

Member Function Documentation

◆ getIDX()

template<class CON , typename PTR = CON*>
size_t getIDX ( ) const
inline

Definition at line 127 of file index-iter.hpp.

◆ setIDX()

template<class CON , typename PTR = CON*>
void setIDX ( size_t  newIDX)
inline

Definition at line 134 of file index-iter.hpp.

+ Inheritance diagram for IndexIter< CON, PTR >:
+ Collaboration diagram for IndexIter< CON, PTR >:

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