Lumiera  0.pre.03
»edit your freedom«
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Opaque Class Reference

Description

opaque private data structure to apply the diff.

This class offers to build a binding for diff messages, which basically maps its internal structures onto the generic "object" scheme underlying the diff language.

Definition at line 77 of file diff-complex-application-test.cpp.

Public Member Functions

 Opaque (string keyID)
 
 Opaque (idi::BareEntryID id)
 
 Opaque (Opaque const &o)
 
void buildMutator (TreeMutator::Handle buff)
 the only way this opaque object exposes itself for mutation through diff messages. More...
 
string identity () const
 
bool isTyped () const
 
const OpaquenestedDelta () const
 
const OpaquenestedObj_1 () const
 
 operator string () const
 
Opaqueoperator= (Opaque const &o)
 
bool verifyAlpha (int x) const
 
bool verifyBeta (int64_t x) const
 
bool verifyData (string desc) const
 
bool verifyGamma (double x) const
 
bool verifyType (string x) const
 

Friends

constexpr size_t treeMutatorSize (const Opaque *)
 override default size traits to allow for sufficient buffer, able to hold the mutator defined above.
 

Private Attributes

int alpha_ = -1
 
int64_t beta_ = -1
 
unique_ptr< Opaquedelta_
 
double gamma_ = -1
 
idi::BareEntryID key_
 
vector< string > nestedData_
 
vector< OpaquenestedObj_
 
string type_ = Rec::TYPE_NIL
 

Member Function Documentation

◆ buildMutator()

void buildMutator ( TreeMutator::Handle  buff)
inline

the only way this opaque object exposes itself for mutation through diff messages.

This function builds a TreeMutator implementation into the given buffer space

Note
some crucial details for this binding to work properly...
  • we define several "onion layers" of binding to deal with various scopes.
  • the priority of these bindings is layered backwards from lowest to highest, i.e. the resulting mutator will fist check for attribute δ and then work its way down do the collection(nestedData_)
  • actually this is a quite complicated setup, including object fields to represent attributes, where only one specific attribute actually holds a nested object and thus needs special treatment; beyond that we have both a collection of child objects and a collection of child data values
  • the selector predicate (isApplicableIf) actually decides if a binding layer becomes responsible for a given diff verb. Here, this decision is based on the classification of the verb or spec to be handled, either being an attribute (named, key-value pair), a nested sub-scope ("object") and finally just any unnamed (non attribute) value
  • the recursive mutation of nested scopes is simply initiated by invoking the same Opaque::buildMutator on the respective children recursively.
  • such an unusually complicated TreeMutator binding leads to increased buffer space requirements for the actual TreeMutator to be generated; Thus we need to implement the extension point treeMutatorSize() to supply a sufficient buffer size value. This function is picked up through ADL, based on the target type Opaque

Definition at line 193 of file diff-complex-application-test.cpp.

References TreeMutator::build(), Opaque::buildMutator(), lib::diff::anonymous_namespace{tree-mutator-collection-binding.hpp}::collection(), PlantingHandle< BA, DEFAULT >::emplace(), DataCap::isNested(), and lib::diff::anonymous_namespace{test-mutation-target.hpp}::render().

Referenced by Opaque::buildMutator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
+ Collaboration diagram for Opaque:

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