Lumiera  0.pre.03
»edit your freedom«
Binding Class Reference

#include "common/advice/binding.hpp"

Description

Conjunction of predicates to be matched against a collaboration partner for establishing an Advice connection.

The binding is defined by a textual spec in prolog-like syntax. The internal representation is immediately normalised. Typically the goal is just to create a #Matcher (Functor) to be stored for later match checks TODO type comment

Definition at line 99 of file common/advice/binding.hpp.

Public Member Functions

 Binding ()
 create the empty binding, equivalent to true
 
 Binding (Literal spec)
 create the binding as defined by the given textual definition. More...
 
void addPredicate (Literal spec)
 extend the definition of this binding by adding a predicate according to the given textual definition
 
template<typename TY >
Binding const & addTypeGuard ()
 
Matcher buildMatcher () const
 
HashVal calculateHash () const
 
 operator string () const
 

Classes

class  Atom
 single predicate as part of an advice binding pattern More...
 
class  Matcher
 Functor object for matching against another Binding. More...
 

Friends

bool operator== (Binding const &, Binding const &)
 bindings are considered equivalent if, after normalisation, their respective definitions are identical. More...
 

Private Types

typedef std::set< AtomNormalisedAtoms
 

Private Member Functions

void parse_and_append (Literal def)
 internal: parse into atoms, and insert them
 

Private Attributes

NormalisedAtoms atoms_
 

Constructor & Destructor Documentation

◆ Binding()

Binding ( Literal  spec)

create the binding as defined by the given textual definition.

Note
implicit type conversion deliberately intended

Definition at line 105 of file common/advice/binding.cpp.

Friends And Related Function Documentation

◆ operator==

bool operator== ( Binding const &  b1,
Binding const &  b2 
)
friend

bindings are considered equivalent if, after normalisation, their respective definitions are identical.

Note
for bindings without variable arguments, equivalence and matching always yield the same results. Contrary to this, two bindings with some variable arguments could match, without being defined identically. For example pred(X) matches pred(u) or any other binding of the form pred(<constant_value>) ////TICKET #615 not yet implemented

Definition at line 173 of file common/advice/binding.cpp.

+ Collaboration diagram for Binding:

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