Lumiera  0.pre.03
»edit your freedom«
CollectionBinding< COLL, MAT, CTR, SEL, ASS, MUT > Struct Template Reference

#include "lib/diff/tree-mutator-collection-binding.hpp"

Description

template<class COLL, class MAT, class CTR, class SEL, class ASS, class MUT>
struct lib::diff::anonymous_namespace{tree-mutator-collection-binding.hpp}::CollectionBinding< COLL, MAT, CTR, SEL, ASS, MUT >

Attach to collection: Concrete binding setup.

This record holds all the actual binding and closures used to attach the tree mutator to an external pre-existing STL container with child elements/objects. It serves as flexible connection, configuration and adaptation element, and will be embedded as a whole into the (ChildCollectionMutator), which in turn implements the TreeMutator interface. The resulting compound is able to consume tree diff messages and apply the respective changes and mutations to an otherwise opaque implementation data structure.

Template Parameters
COLLa STL compliant collection type holding "child elements"
MATa functor to determine if a child matches a diff spec (GenNode)
CTRa functor to construct a new child element from a given diff spec
SELpredicate to determine if this binding layer has to process a diff message
ASSa functor to assign / set a new value from a given diff spec
MUTa functor to construct a nested mutator for some child element

Definition at line 197 of file tree-mutator-collection-binding.hpp.

Public Types

using Coll = typename Strip< COLL >::TypeReferred
 
using const_iterator = typename lib::iter_stl::_SeqT< const Coll >::Range
 
using Elm = typename Coll::value_type
 
using iterator = typename lib::iter_stl::_SeqT< Coll >::Range
 
using Trait = ContainerTraits< Coll >
 

Public Member Functions

 CollectionBinding (Coll &coll, MAT m, CTR c, SEL s, ASS a, MUT u)
 
iterator initMutation ()
 
void inject (Elm &&elm)
 
iterator locate (GenNode const &targetSpec)
 locate element for assignment or mutation, with special shortcut to the recently inserted element
 
iterator search (GenNode const &targetSpec, iterator pos)
 

Public Attributes

ASS assign
 
Coll & collection
 
CTR construct
 
Coll contentBuffer
 
SEL isApplicable
 
MAT matches
 
MUT openSub
 

Private Member Functions

Elm & recentElm ()
 
iterator recentElmIter ()
 

Additional Inherited Members

- Protected Member Functions inherited from MoveOnly
 MoveOnly (MoveOnly &&)=default
 
 MoveOnly (MoveOnly const &)=delete
 
MoveOnlyoperator= (MoveOnly &&)=delete
 
MoveOnlyoperator= (MoveOnly const &)=delete
 

Member Function Documentation

◆ recentElmIter()

iterator recentElmIter ( )
inlineprivate

technicality Our iterator is actually a Lumiera RangeIter, and thus we need to construct a raw collection iterator pointing to the aftmost element and then create a range from this iterator and the end() iterator.

Definition at line 284 of file tree-mutator-collection-binding.hpp.

+ Inheritance diagram for CollectionBinding< COLL, MAT, CTR, SEL, ASS, MUT >:
+ Collaboration diagram for CollectionBinding< COLL, MAT, CTR, SEL, ASS, MUT >:

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