![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "common/advice/binding.hpp"
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.
Classes | |
| class | Atom |
| single predicate as part of an advice binding pattern More... | |
| class | Matcher |
| Functor object for matching against another Binding. More... | |
Public Member Functions | |
| Binding () | |
create the empty binding, equivalent to true | |
| Binding (Literal spec) | |
| create the binding as defined by the given textual definition. | |
| 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 | |
| template<typename TY > | |
| Binding const & | addTypeGuard () |
Friends | |
| bool | operator== (Binding const &, Binding const &) |
| bindings are considered equivalent if, after normalisation, their respective definitions are identical. | |
Private Types | |
| typedef std::set< Atom > | NormalisedAtoms |
Private Member Functions | |
| void | parse_and_append (Literal def) |
| internal: parse into atoms, and insert them | |
Private Attributes | |
| NormalisedAtoms | atoms_ |
| Binding | ( | ) |
create the empty binding, equivalent to true
Definition at line 101 of file common/advice/binding.cpp.
create the binding as defined by the given textual definition.
Definition at line 105 of file common/advice/binding.cpp.
References Binding::parse_and_append().
Here is the call graph for this function:
|
private |
Definition at line 149 of file common/advice/binding.hpp.
| void addPredicate | ( | Literal | spec | ) |
extend the definition of this binding by adding a predicate according to the given textual definition
Definition at line 113 of file common/advice/binding.cpp.
References Binding::parse_and_append().
Referenced by AdviceBindingPattern_test::verifyPatternNormalisation(), and AdviceBindingPattern_test::verifyPatternSyntax().
Here is the call graph for this function:
Here is the caller graph for this function:| Binding const & addTypeGuard | ( | ) |
Referenced by AdviceBindingPattern_test::verifyPatternNormalisation(), and AdviceBindingPattern_test::verifyPatternSyntax().
Here is the caller graph for this function:
|
inline |
Definition at line 250 of file common/advice/binding.hpp.
References Binding::calculateHash().
Referenced by TestPOA::changeBinding(), lumiera::advice::matches(), PointOfAdvice::setBindingPattern(), and AdviceBindingPattern_test::verifyPreparedMatch().
Here is the call graph for this function:
Here is the caller graph for this function:| HashVal calculateHash | ( | ) | const |
Definition at line 146 of file common/advice/binding.cpp.
References Binding::atoms_, and hash.
Referenced by Binding::buildMatcher(), lumiera::advice::hash_value(), and Binding::Matcher::matches().
Here is the caller graph for this function:| operator string | ( | ) | const |
Definition at line 121 of file common/advice/binding.cpp.
|
private |
internal: parse into atoms, and insert them
Definition at line 77 of file common/advice/binding.cpp.
References Binding::atoms_.
Referenced by Binding::Binding(), and Binding::addPredicate().
Here is the caller graph for this function:
|
inline |
Definition at line 217 of file common/advice/binding.hpp.
References Binding::atoms_.
|
private |
Definition at line 151 of file common/advice/binding.hpp.
Referenced by Binding::addTypeGuard(), Binding::calculateHash(), and Binding::parse_and_append().
bindings are considered equivalent if, after normalisation, their respective definitions are identical.
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: