Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
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 ()
 
 Opaque (string keyID)
 
 Opaque (idi::BareEntryID id)
 
 Opaque (Opaque const &o)
 
Opaqueoperator= (Opaque const &o)
 
bool verifyType (string x) const
 
bool verifyAlpha (int x) const
 
bool verifyBeta (int64_t x) const
 
bool verifyGamma (double x) const
 
bool verifyData (string desc) const
 
const OpaquenestedDelta () const
 
const OpaquenestedObj_1 () const
 
 operator string () const
 
string identity () const
 
bool isTyped () const
 
void buildMutator (TreeMutator::Handle buff)
 the only way this opaque object exposes itself for mutation through diff messages.
 

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

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

Constructor & Destructor Documentation

◆ Opaque() [1/4]

Opaque ( )
inline

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

◆ Opaque() [2/4]

Opaque ( string  keyID)
inlineexplicit

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

◆ Opaque() [3/4]

Opaque ( idi::BareEntryID  id)
inlineexplicit

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

◆ Opaque() [4/4]

Opaque ( Opaque const &  o)
inline

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

References Opaque::delta_.

Member Function Documentation

◆ operator=()

Opaque & operator= ( Opaque const &  o)
inline

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

◆ verifyType()

bool verifyType ( string  x) const
inline

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

◆ verifyAlpha()

bool verifyAlpha ( int  x) const
inline

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

◆ verifyBeta()

bool verifyBeta ( int64_t  x) const
inline

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

◆ verifyGamma()

bool verifyGamma ( double  x) const
inline

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

◆ verifyData()

bool verifyData ( string  desc) const
inline

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

◆ nestedDelta()

const Opaque * nestedDelta ( ) const
inline

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

References NULL.

◆ nestedObj_1()

const Opaque * nestedObj_1 ( ) const
inline

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

References NULL.

◆ operator string()

operator string ( ) const
inline

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

◆ identity()

string identity ( ) const
inline

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

References BareEntryID::getHash(), BareEntryID::getSym(), and lib::idi::format::instance_hex_format().

+ Here is the call graph for this function:

◆ isTyped()

bool isTyped ( ) const
inline

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

◆ 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 GenNode::data, PlantingHandle< BA, DEFAULT >::emplace(), GenNode::idi, GenNode::isNamed(), and DataCap::isNested().

+ Here is the call graph for this function:

Member Data Documentation

◆ key_

idi::BareEntryID key_
private

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

◆ type_

string type_ = Rec::TYPE_NIL
private

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

◆ alpha_

int alpha_ = -1
private

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

◆ beta_

int64_t beta_ = -1
private

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

◆ gamma_

double gamma_ = -1
private

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

◆ delta_

unique_ptr<Opaque> delta_
private

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

Referenced by Opaque::Opaque().

◆ nestedObj_

vector<Opaque> nestedObj_
private

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

◆ nestedData_

vector<string> nestedData_
private

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

Friends And Related Symbol Documentation

◆ treeMutatorSize

constexpr size_t treeMutatorSize ( const Opaque )
friend

override default size traits to allow for sufficient buffer, able to hold the mutator defined above.

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

+ Collaboration diagram for Opaque:

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