Lumiera  0.pre.03
»edit your freedom«
IterCoreAdapter_test Class Reference

Description

Test:
cover the concept of a »state core«, which is used in Lumiera for various aspects of data generation and iteration.
See also
IterStateWrapper
iter-adapter.hpp
iter-explorer.hpp

Definition at line 94 of file iter-core-adapter-test.cpp.

Private Types

template<typename T1 , typename T2 >
using Common = meta::CommonResultYield< T1, T2 >
 

Private Member Functions

void checked_and_protected ()
 
virtual void run (Arg)
 
void simpleUsage ()
 
void stateManipulation ()
 
void value_and_reference_yield ()
 
void verify_TypeReconciliation ()
 

Member Function Documentation

◆ simpleUsage()

void simpleUsage ( )
inlineprivate
Test:
build a »Lumiera Forward Iterator« to transition a State-Core towards it final state.

Definition at line 113 of file iter-core-adapter-test.cpp.

◆ stateManipulation()

void stateManipulation ( )
inlineprivate
Test:
state of a decorated un-checked core can be manipulated

Definition at line 131 of file iter-core-adapter-test.cpp.

◆ checked_and_protected()

void checked_and_protected ( )
inlineprivate
Test:
additional wrappers to add safety checks or to encapsulate the state core altogether

Definition at line 156 of file iter-core-adapter-test.cpp.

References VERIFY_ERROR.

◆ value_and_reference_yield()

void value_and_reference_yield ( )
inlineprivate
Test:
adapters can (transparently) handle a core which yields values
  • demonstrate how cores can be augmented by decoration...
  • the decorated core here yields by-value, not by-ref.
  • Both CheckedCore and IterableDecorator can cope with that
  • the result is then also delivered by-value from the iterator.
    Remarks
    the »Lumiera Forward Iterator« concept does not exactly specify what to expect when dereferencing an iterator; yet for obvious reasons, most iterators in practice expose a reference to some underlying container or internal engine state, since this is more or less the whole point of using an iterator: we want to expose something for manipulation, without revealing what it actually is (even while in most cases the implementation is visible for the compiler, the code using the iterator is not tightly coupled). This scheme has ramifications for the way any iterator pipeline works; notably any transformation will have to capture a function result. However, sometimes an iterator can only return a computed value; such an usage can be valid and acceptable and is supported to the degree possible.

Definition at line 200 of file iter-core-adapter-test.cpp.

References lib::test::showType(), and VERIFY_ERROR.

+ Here is the call graph for this function:

◆ verify_TypeReconciliation()

void verify_TypeReconciliation ( )
inlineprivate
Test:
construction of a common result type.
  • based on std::common_type
  • so there must be some common ground
  • if any of the types is by-value, the result is
  • if any of the types is const, the result is const

Definition at line 237 of file iter-core-adapter-test.cpp.

+ Inheritance diagram for IterCoreAdapter_test:
+ Collaboration diagram for IterCoreAdapter_test:

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