Lumiera  0.pre.03
»edit your freedom«
IterSource< TY > Class Template Referenceabstract

#include "lib/iter-source.hpp"

Description

template<typename TY>
class lib::IterSource< TY >

Iteration source interface to abstract a data source, which then can be accessed through IterAdapter as a frontend, allowing to pull individual elements until exhaustion.

This base class is empty and makes no assumptions regarding identity, instantiation and copying.

See also
PlacementIndex::Table::_eachEntry_4check usage example
iter-source-test.cpp

Definition at line 79 of file iter-source.hpp.

Public Types

using pointer = TY *
 
using reference = TY &
 
using value_type = TY
 

Public Member Functions

virtual operator string () const
 is ABC More...
 

Static Public Member Functions

static iterator build (IterSource &sourceImpl)
 build an iterator frontend for the given source, More...
 
static iterator build (IterSource *sourceImplObject)
 build an iterator frontend, thereby managing the given heap allocated source object instance. More...
 

Static Public Attributes

static iterator EMPTY_SOURCE = iterator()
 storage for the empty data-source constant
 

Classes

struct  iterator
 

Friends

bool checkPoint (DataHandle const &, Pos const &pos)
 
void iterNext (DataHandle &source, Pos &pos)
 

Protected Types

typedef shared_ptr< IterSourceDataHandle
 
typedef TY * Pos
 

Protected Member Functions

virtual void disconnect ()
 disconnect the data source / iteration frontend. More...
 
virtual Pos firstResult ()=0
 iteration start: prepare the first element. More...
 
virtual void nextResult (Pos &pos)=0
 iteration step: switch on to the next element. More...
 

Static Private Member Functions

static void destroy_managed_source (IterSource *source)
 
static void detach_without_destroy (IterSource *source)
 
static iterator startIteration (DataHandle sourceHandle)
 

Member Function Documentation

◆ firstResult()

virtual Pos firstResult ( )
protectedpure virtual

iteration start: prepare the first element.

may return NULL in case of empty data source

Implemented in DiagnosticOutputSlot::OutputFramesLog, NummyGenerator, and TestSource.

◆ nextResult()

virtual void nextResult ( Pos &  pos)
protectedpure virtual

iteration step: switch on to the next element.

The pos pointer should be set to NULL to report iteration end

Implemented in DiagnosticOutputSlot::OutputFramesLog, NummyGenerator, and TestSource.

◆ disconnect()

virtual void disconnect ( )
inlineprotectedvirtual

disconnect the data source / iteration frontend.

Depending on the way the IterSource got created this might (or might not) be followed by destroying the data source.

Note
must not throw

Definition at line 105 of file iter-source.hpp.

◆ operator string()

virtual operator string ( ) const
inlinevirtual

is ABC

< subclasses may offer diagnostics

Definition at line 113 of file iter-source.hpp.

◆ build() [1/2]

static iterator build ( IterSource< TY > &  sourceImpl)
inlinestatic

build an iterator frontend for the given source,

Note
the source is allocated separately and not owned by the iterator frontend

Definition at line 151 of file iter-source.hpp.

Referenced by lib::iter_source::eachEntry(), MutationMessage::MutationMessage(), lib::iter_source::singleVal(), lib::iter_source::transform(), and lib::iter_source::wrapIter().

+ Here is the caller graph for this function:

◆ build() [2/2]

static iterator build ( IterSource< TY > *  sourceImplObject)
inlinestatic

build an iterator frontend, thereby managing the given heap allocated source object instance.

Note
we take ownership and destroy the source when the last copy of the created iterator goes out of scope.

Definition at line 164 of file iter-source.hpp.

+ Inheritance diagram for IterSource< TY >:
+ Collaboration diagram for IterSource< TY >:

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