Lumiera  0.pre.03
»edit your freedom«
IterSourceIter< ISO > Class Template Reference

#include "lib/iter-explorer.hpp"

Description

template<class ISO>
class lib::iter_explorer::IterSourceIter< ISO >

Adapt an IterSource to make it iterable.

As such, lib::IterSource is meant to be iterable, while only exposing a conventional VTable-based iteration interface. To support this usage, the library offers some builders to attach an iterator adapter. Two flavours need to be distinguished:

  • we get a reference to something living elsewhere; all we know is it's iterable.
  • we get a pointer, indicating that we must take ownership and manage the lifetime. The iterable entity in this case can be assumed to be heap allocated, featuring a virtual destructor. The generated front-end has identical type in both cases; it is based on a shared_ptr, just a different deleter function is used in both cases. This design makes sense, since the protocol requires us to invoke virtual function IterSource::disconnect() when use count goes to zero.

Definition at line 196 of file iter-explorer.hpp.

Public Types

using Source = ISO
 

Public Member Functions

 IterSourceIter (ISO &externalSource)
 link to existing IterSource (without memory management)
 
 IterSourceIter (ISO *heapObject)
 own and manage a heap allocated IterSource
 
Source & source ()
 

Private Types

using Iterator = typename ISO::iterator
 
+ Inheritance diagram for IterSourceIter< ISO >:
+ Collaboration diagram for IterSourceIter< ISO >:

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