98 #ifndef LUMIERA_ADVICE_H 99 #define LUMIERA_ADVICE_H 144 pattern_ = binding.buildMatcher();
150 : pattern_(binding.buildMatcher())
151 , resolution_(
nullptr)
163 resolution_ = solution;
181 return hash_value (entry.pattern_);
199 void discardSolutions ();
200 void publishRequestBindingChange(
HashVal);
202 void registerRequest();
203 void deregisterRequest();
205 static void* getBuffer(
size_t);
206 static void releaseBuffer (
void*,
size_t);
208 typedef void (DeleterFunc)(
void*);
251 void deregister() { }
268 setSolution ( NULL );
274 if (!isSameObject(*
this, o))
276 AdviceLink::operator= (o);
277 setSolution ( NULL );
283 void setAdvice (AD
const& pieceOfAdvice)
286 storeCopy (pieceOfAdvice));
297 return bool{this->getSolution()};
309 static void releaseAdviceData (
void*);
310 void maybe_rePublish ();
342 , theAdvice_(advice_given)
344 this->setSolution (
this);
362 void* storage = getBuffer(
sizeof(Holder));
365 Holder* storedProvision =
new(storage) Holder (*
this, advice_given);
366 manageAdviceData (storedProvision, &releaseAdviceData);
367 return storedProvision;
372 releaseBuffer (storage,
sizeof(Holder));
389 Holder* obj =
static_cast<Holder*
> (
entry);
391 releaseBuffer (entry,
sizeof(Holder));
405 AdviceProvision* solution =
static_cast<AdviceProvision*
> (getSolution());
409 storeCopy (solution->getAdvice()));
471 AdviceProvision* solution =
static_cast<AdviceProvision*
> (this->getSolution());
473 return this->handleMissingSolution();
475 return solution->getAdvice();
486 return bool{this->getSolution()};
494 HashVal previous_bindingKey (hash_value(*
this));
496 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, bypassing any custom comparison operators.