![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "common/advice.hpp"
Access point for the advising entity (server).
This is the interface intended for client code to set and provide concrete advice information of a specific type AD. Instantiating automatically creates a type-guard binding pattern, but client code can (and typically should) provide additional predicates to define the "topic" this advice belongs to. This allows advice::Request entries to attach to the suitable advice "channels" and get the specific piece of advice they're looking for.
Any advice::Provision remains inactive and thus invisible, until setting the concrete advice data. After that, the provided data is copied into the AdviceSystem and remains available even after the original Provision goes out of scope. Consequently, it is not possible to modify advice data once set. But client code may retract the provision or change the binding pattern.
Definition at line 235 of file advice.hpp.
Public Member Functions | |
| Provision (Literal bindingSpec=0) | |
| ~Provision () | |
| Provision (Provision const &o) | |
| Provision & | operator= (Provision const &o) |
| void | setAdvice (AD const &pieceOfAdvice) |
| void | retractAdvice () |
| bool | isGiven () const |
| void | defineBinding (Literal topic) |
Private Member Functions | |
| void | deregister () |
| PointOfAdvice * | storeCopy (AD const &advice_given) |
| void | maybe_rePublish () |
Static Private Member Functions | |
| static void | releaseAdviceData (void *) |
Additional Inherited Members | |
Protected Types inherited from AdviceLink | |
| typedef void() | DeleterFunc(void *) |
Protected Member Functions inherited from AdviceLink | |
| void | publishProvision (PointOfAdvice *) |
| when the Provision actually sets advice data, this is copied into an internal buffer within the AdviceSystem. | |
| void | discardSolutions () |
| when advice is retracted explicitly, after removing the provision index entry we also need to re-process any requests which happen to match our binding... | |
| void | publishRequestBindingChange (HashVal) |
| void | registerRequest () |
| void | deregisterRequest () |
| AdviceLink (Binding const &binding) | |
Protected Member Functions inherited from PointOfAdvice | |
| void | setBindingPattern (Binding const &binding) |
| define or re-define the binding, which specifically labels this attachment to the advice system. | |
| PointOfAdvice (Binding const &binding) | |
| void | setSolution (PointOfAdvice *solution=0) |
| const PointOfAdvice * | getSolution () const |
| Binding::Matcher | getMatcher () const |
Static Protected Member Functions inherited from AdviceLink | |
| static void * | getBuffer (size_t) |
| allocate raw storage for a buffer holding the actual piece of advice. | |
| static void | releaseBuffer (void *, size_t) |
| static void | manageAdviceData (PointOfAdvice *, DeleterFunc *) |
| Store a descriptor record to take ownership of the given allocation. | |
Definition at line 247 of file advice.hpp.
|
inline |
Definition at line 251 of file advice.hpp.
References Provision< AD >::deregister().
Here is the call graph for this function:Definition at line 256 of file advice.hpp.
References NULL, and PointOfAdvice::setSolution().
Here is the call graph for this function:
|
inlineprivate |
Definition at line 242 of file advice.hpp.
Referenced by Provision< AD >::~Provision().
Here is the caller graph for this function:Definition at line 263 of file advice.hpp.
References PointOfAdvice::setSolution().
Here is the call graph for this function:
|
inline |
Definition at line 274 of file advice.hpp.
References AdviceLink::publishProvision(), and Provision< AD >::storeCopy().
Referenced by AdviceSituations_test::pattern01_justPickAndBeHappy(), AdviceSituations_test::pattern02_pickIfPresent(), UiStyle::prepareStyleContext(), TheAdvisor::publish(), and steam::asset::meta::anonymous_namespace{time-grid.cpp}::publishWrapped().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 280 of file advice.hpp.
References AdviceLink::discardSolutions().
Referenced by TheAdvisor::clear().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 286 of file advice.hpp.
References PointOfAdvice::getSolution().
Referenced by UiStyle::prepareStyleContext().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 292 of file advice.hpp.
References Provision< AD >::maybe_rePublish(), and PointOfAdvice::setBindingPattern().
Referenced by TheAdvisor::rebind().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
function to copy advice into an internal buffer.
| error::Fatal | on allocation problems, plus anything the advice data may throw during copy construction. |
Definition at line 350 of file advice.hpp.
References lumiera_error().
Referenced by Provision< AD >::setAdvice().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestaticprivate |
assist the AdviceSystem with deallocating buffer storage. Problem is we need to know the exact size of the advice value holder, which information is available only here, in the fully typed context.
Definition at line 375 of file advice.hpp.
|
inlineprivate |
in case we've already published this provision, we temporarily need a new provision entry, to allow the AdviceSystem implementation to rewrite the internal index
Definition at line 393 of file advice.hpp.
Referenced by Provision< AD >::defineBinding().
Here is the caller graph for this function:
Inheritance diagram for Provision< AD >:
Collaboration diagram for Provision< AD >: