Lumiera  0.pre.03
»edit your freedom«
IterIndex< CON, PTR > Class Template Reference

#include "lib/iter-index.hpp"

Description

template<class CON, typename PTR = CON*>
class lib::IterIndex< 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 IterIndex and some exhausted IterIndex compare equal, only the latter can be re-set into active state.

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

Public Member Functions

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

Private Types

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

Additional Inherited Members

- Public Types inherited from IterStateWrapper< T, ST >
typedef T * pointer
 
typedef T & reference
 
typedef T value_type
 
- Protected Member Functions inherited from IterStateWrapper< T, ST >
void __throw_if_empty () const
 
ST & stateCore ()
 allow derived classes to access state representation
 
ST const & stateCore () const
 
+ Inheritance diagram for IterIndex< CON, PTR >:
+ Collaboration diagram for IterIndex< CON, PTR >:

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