89 #ifndef LUMIERA_ADVICE_H 90 #define LUMIERA_ADVICE_H 135 pattern_ = binding.buildMatcher();
141 : pattern_(binding.buildMatcher())
142 , resolution_(
nullptr)
154 resolution_ = solution;
172 return hash_value (entry.pattern_);
190 void discardSolutions ();
191 void publishRequestBindingChange(
HashVal);
193 void registerRequest();
194 void deregisterRequest();
196 static void* getBuffer(
size_t);
197 static void releaseBuffer (
void*,
size_t);
199 typedef void (DeleterFunc)(
void*);
242 void deregister() { }
259 setSolution ( NULL );
265 if (not isSameObject (*
this, o))
267 AdviceLink::operator= (o);
268 setSolution (
nullptr);
274 void setAdvice (AD
const& pieceOfAdvice)
277 storeCopy (pieceOfAdvice));
288 return bool{this->getSolution()};
300 static void releaseAdviceData (
void*);
301 void maybe_rePublish ();
333 , theAdvice_(advice_given)
335 this->setSolution (
this);
353 void* storage = getBuffer(
sizeof(Holder));
356 Holder* storedProvision =
new(storage) Holder (*
this, advice_given);
357 manageAdviceData (storedProvision, &releaseAdviceData);
358 return storedProvision;
363 releaseBuffer (storage,
sizeof(Holder));
380 Holder* obj =
static_cast<Holder*
> (
entry);
382 releaseBuffer (entry,
sizeof(Holder));
396 AdviceProvision* solution =
static_cast<AdviceProvision*
> (getSolution());
400 storeCopy (solution->getAdvice()));
462 AdviceProvision* solution =
static_cast<AdviceProvision*
> (this->getSolution());
464 return this->handleMissingSolution();
466 return solution->getAdvice();
477 return bool{this->getSolution()};
485 HashVal previous_bindingKey (hash_value(*
this));
487 publishRequestBindingChange (previous_bindingKey);
Access point for the advised entity (client).
Conjunction of predicates to be matched against a collaboration partner for establishing an Advice co...
Functor object for matching against another Binding.
Advice Collaboration partner, internally connected to the AdviceSystem.
Basic (abstracted) view of an advice collaboration partner, as used internally by the AdviceSystem to...
void defineBinding(Literal topic)
set and possibly change the binding term used to retrieve Advice
Piece of Advice as incorporated into the AdviceSystem.
static void releaseAdviceData(void *)
AnyPair entry(Query< TY > const &query, typename WrapReturn< TY >::Wrapper &obj)
helper to simplify creating mock table entries, wrapped correctly
Any copy and copy construction prohibited.
inline string literal This is a marker type to indicate that
Singleton holder for NIL or default value objects.
PointOfAdvice * storeCopy(AD const &advice_given)
Singleton-style holder for NIL or default values.
Derived specific exceptions within Lumiera's exception hierarchy.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Access point for the advising entity (server).
A pattern to define and identify a specific attachment to the Advice system.
Marker types to indicate a literal string and a Symbol.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
lumiera_err lumiera_error(void)
Get and clear current error state.
Lumiera error handling (C++ interface).
size_t HashVal
a STL compatible hash value
Lumiera public interface.
AD const & handleMissingSolution() const
<
void setBindingPattern(Binding const &binding)
define or re-define the binding, which specifically labels this attachment to the advice system...
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities. ...