Lumiera
0.pre.03
»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 const &o) | |
void | defineBinding (Literal topic) |
bool | isGiven () const |
Provision & | operator= (Provision const &o) |
void | retractAdvice () |
void | setAdvice (AD const &pieceOfAdvice) |
Private Member Functions | |
void | deregister () |
void | maybe_rePublish () |
PointOfAdvice * | storeCopy (AD const &advice_given) |
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 | deregisterRequest () |
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... More... | |
void | publishProvision (PointOfAdvice *) |
when the Provision actually sets advice data, this is copied into an internal buffer within the AdviceSystem. More... | |
void | publishRequestBindingChange (HashVal) |
void | registerRequest () |
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. More... | |
PointOfAdvice (Binding const &binding) | |
Binding::Matcher | getMatcher () const |
const PointOfAdvice * | getSolution () const |
void | setSolution (PointOfAdvice *solution=0) |
Static Protected Member Functions inherited from AdviceLink | |
static void * | getBuffer (size_t) |
allocate raw storage for a buffer holding the actual piece of advice. More... | |
static void | manageAdviceData (PointOfAdvice *, DeleterFunc *) |
Store a descriptor record to take ownership of the given allocation. More... | |
static void | releaseBuffer (void *, size_t) |
|
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.
|
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.