Lumiera  0.pre.03
»edit your freedom«
AttributeBindingBase< PAR > Class Template Reference

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

Description

template<class PAR>
class lib::diff::anonymous_namespace{tree-mutator-attribute-binding.hpp}::AttributeBindingBase< PAR >

Generic behaviour of any binding to object fields (attributes).

Since object fields as such are part of the class definition, a diff will never be able to add, insert, delete or re-order fields. Thus we do not need to keep track of an "old" and "new" order; rather there is always one single fixed element present to work on.

Note
consequently, several diff operations are either implemented NOP, or passed to the parent (lower onion layers).

Definition at line 134 of file tree-mutator-attribute-binding.hpp.

Public Member Functions

virtual bool accept_until (GenNode const &spec) override
 there is no real support for navigating to a 'position', since attribute / data field binding has no notion of ordering. More...
 
virtual bool acceptSrc (GenNode const &spec) override
 accept status quo, after verifying the spec from the diff verb
 
virtual bool findSrc (GenNode const &refSpec) override
 
virtual bool matchSrc (GenNode const &spec) override
 ensure the given spec is deemed appropriate at that point. More...
 
virtual void skipSrc (GenNode const &refSpec) override
 any reordering or deletion of object fields is prohibited More...
 

Protected Member Functions

 AttributeBindingBase (BareEntryID attribID, PAR &&chain)
 
void __ifApplicable_refuse_to (Literal oper, GenNode const &spec)
 
bool isApplicable (GenNode const &spec)
 hard wired "selector predicate" for this binding layer. More...
 

Private Attributes

BareEntryID attribID_
 

Member Function Documentation

◆ isApplicable()

bool isApplicable ( GenNode const &  spec)
inlineprotected

hard wired "selector predicate" for this binding layer.

We handle only mutation operations pertaining attributes which additionally match the key defined at binding time. Any other operations are passed down the chain.

Parameters
spectarget specification given within the diff verb
Returns
if this binding is in charge for handling the spec

Definition at line 154 of file tree-mutator-attribute-binding.hpp.

◆ matchSrc()

virtual bool matchSrc ( GenNode const &  spec)
inlineoverridevirtual

ensure the given spec is deemed appropriate at that point.

Due to the hard wired nature of an object field binding, this can only be verified passively: a spec targeted at an unknown attribute will be rejected. But since there is no notion of "ordering" for (object) data fields, we can not verify the diff's completeness.

Definition at line 180 of file tree-mutator-attribute-binding.hpp.

◆ skipSrc()

virtual void skipSrc ( GenNode const &  refSpec)
inlineoverridevirtual

any reordering or deletion of object fields is prohibited

Exceptions
error::Logicwhen this binding layer becomes responsible for handling the given diff spec, because a proper diff must be arranged in a way not to ask this binding to "reorder" a field from an existing class definition.

Definition at line 205 of file tree-mutator-attribute-binding.hpp.

◆ accept_until()

virtual bool accept_until ( GenNode const &  spec)
inlineoverridevirtual

there is no real support for navigating to a 'position', since attribute / data field binding has no notion of ordering.

An attempt to fast-forward to "the end" is tolerated though.

Exceptions
error::Logicwhen this binding becomes responsible and a request to navigate to some specific attribute is detected
Note
the diff spec Ref::END or Ref::ATTRIBS is tolerated and implemented as NOP (since there is no 'position' incorporated into the binding implementation.

Definition at line 228 of file tree-mutator-attribute-binding.hpp.

References Ref::ATTRIBS, and Ref::END.

+ Inheritance diagram for AttributeBindingBase< PAR >:
+ Collaboration diagram for AttributeBindingBase< PAR >:

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