Lumiera  0.pre.03
»edit your freedom«
IterSnapshot< VAL > Class Template Reference

#include "lib/iter-adapter-stl.hpp"

Description

template<typename VAL>
class lib::iter_stl::IterSnapshot< VAL >

materialised iterator contents.

At construction, the given source iterator is immediately discharged into an internal buffer (vector). This captured value sequence can then be retrieved once as Lumiera Forward Iterator

Definition at line 423 of file iter-adapter-stl.hpp.

Public Types

typedef VAL * pointer
 
typedef VAL & reference
 
typedef VAL value_type
 

Public Member Functions

 IterSnapshot ()
 create empty snapshot
 
template<class IT >
 IterSnapshot (IT &src)
 take snapshot by discharging the given Lumiera Forward iterator More...
 
template<class IT >
 IterSnapshot (IT const &src)
 build snapshot from a copy of the Lumiera Iterator More...
 
template<class IT >
 IterSnapshot (IT &pos, IT const &end)
 take snapshot by consuming a STL iterator
 
template<class IT >
 IterSnapshot (IT const &begin, IT const &end)
 take snapshot from STL iterator
 
 IterSnapshot (IterSnapshot &&)=default
 
 IterSnapshot (IterSnapshot const &)=default
 
bool empty () const
 
bool isValid () const
 
 operator bool () const
 
reference operator* () const
 
IterSnapshotoperator++ ()
 
pointer operator-> () const
 
IterSnapshotoperator= (IterSnapshot const &)=default
 
IterSnapshotoperator= (IterSnapshot &&)=default
 
size_t size () const
 

Friends

bool operator!= (IterSnapshot const &snap1, IterSnapshot const &snap2)
 
bool operator== (IterSnapshot const &s1, IterSnapshot const &s2)
 equality is based first on the valid state (to support pos != end) and then on the actual position and contents of the snapshots
 

Private Types

typedef std::vector< VAL > Sequence
 

Private Member Functions

void _maybe_throw () const
 

Private Attributes

Sequence buffer_
 
size_t pos_ = 0
 

Constructor & Destructor Documentation

◆ IterSnapshot() [1/2]

IterSnapshot ( IT &  src)
inline

take snapshot by discharging the given Lumiera Forward iterator

Warning
depending on the implementation backing the source iterator, this might or might not yield side-effects.

Definition at line 441 of file iter-adapter-stl.hpp.

◆ IterSnapshot() [2/2]

IterSnapshot ( IT const &  src)
inline

build snapshot from a copy of the Lumiera Iterator

Warning
depending on the implementation backing the source iterator, this might or might not yield side-effects.

Definition at line 452 of file iter-adapter-stl.hpp.

+ Collaboration diagram for IterSnapshot< VAL >:

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