Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
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 126 of file tree-mutator-attribute-binding.hpp.

Public Member Functions

virtual bool matchSrc (GenNode const &spec) override
 ensure the given spec is deemed appropriate at that point.
 
virtual bool acceptSrc (GenNode const &spec) override
 accept status quo, after verifying the spec from the diff verb
 
virtual void skipSrc (GenNode const &refSpec) override
 any reordering or deletion of object fields is prohibited
 
virtual bool findSrc (GenNode const &refSpec) override
 
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.
 

Protected Member Functions

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

Private Attributes

BareEntryID attribID_
 

Constructor & Destructor Documentation

◆ AttributeBindingBase()

template<class PAR >
AttributeBindingBase ( BareEntryID  attribID,
PAR &&  chain 
)
inlineprotected

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

Member Function Documentation

◆ isApplicable()

template<class PAR >
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 146 of file tree-mutator-attribute-binding.hpp.

References GenNode::idi, and GenNode::isNamed().

+ Here is the call graph for this function:

◆ __ifApplicable_refuse_to()

template<class PAR >
void __ifApplicable_refuse_to ( Literal  oper,
GenNode const &  spec 
)
inlineprotected

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

References GenNode::idi.

◆ matchSrc()

template<class PAR >
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 172 of file tree-mutator-attribute-binding.hpp.

◆ acceptSrc()

template<class PAR >
virtual bool acceptSrc ( GenNode const &  spec)
inlineoverridevirtual

accept status quo, after verifying the spec from the diff verb

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

◆ skipSrc()

template<class PAR >
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 197 of file tree-mutator-attribute-binding.hpp.

◆ findSrc()

template<class PAR >
virtual bool findSrc ( GenNode const &  refSpec)
inlineoverridevirtual

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

◆ accept_until()

template<class PAR >
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 220 of file tree-mutator-attribute-binding.hpp.

Member Data Documentation

◆ attribID_

template<class PAR >
BareEntryID attribID_
private

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

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

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