Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
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 190 of file iter-explorer.hpp.

Public Types

using Source = ISO
 

Public Member Functions

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

Private Types

using Iterator = ISO::iterator
 

Constructor & Destructor Documentation

◆ IterSourceIter() [1/3]

template<class ISO >
IterSourceIter ( )
default

◆ IterSourceIter() [2/3]

template<class ISO >
IterSourceIter ( ISO &  externalSource)
inline

link to existing IterSource (without memory management)

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

◆ IterSourceIter() [3/3]

template<class ISO >
IterSourceIter ( ISO *  heapObject)
inline

own and manage a heap allocated IterSource

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

Member Typedef Documentation

◆ Iterator

template<class ISO >
using Iterator = ISO::iterator
private

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

◆ Source

template<class ISO >
using Source = ISO

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

Member Function Documentation

◆ source()

template<class ISO >
Source & source ( )
inline

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

+ Inheritance diagram for IterSourceIter< ISO >:
+ Collaboration diagram for IterSourceIter< ISO >:

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