127 TRACE (library,
"Initialising Advice Index tables.");
132 TRACE (library,
"Shutting down Advice system.");
149 try {
return new char[siz]; }
151 catch(std::bad_alloc&)
153 throw error::Fatal(
"Unable to store Advice due to memory exhaustion");
162 delete[] (
char*)buff;
169 adviceDataRegistry_.
manage (entry, how_to_delete);
178 adviceDataRegistry_.
kill (storedProvision);
188 HashVal previous_bindingKey)
213 WARN (library,
"Problems on deregistration of advice request: %s", errID.
c());
223 if (not previousProvision and newProvision)
226 if (previousProvision and newProvision)
229 if (previousProvision and not newProvision)
232 discardEntry (unConst(previousProvision));
240 if (existingProvision)
243 discardEntry (unConst(existingProvision));
273 return aSys().allocateBuffer(siz);
280 aSys().releaseBuffer(buff, siz);
294 aSys().manageAdviceData (entry,how_to_delete);
318 aSys().publishProvision (newProvision, previousProvision);
335 aSys().discardSolutions (existingProvision);
342 aSys().publishRequestBindingChange (*
this, previous_bindingKey);
349 aSys().registerRequest (*
this);
356 aSys().deregisterRequest (*
this);
void() DeleterFunc(void *)
Expecting Advice and giving Advice: a cross-cutting collaboration of loosely coupled participants.
Manage a collection of deleter functions.
Access point to singletons and other kinds of dependencies designated by type.
constexpr const char * c() const
scoped guard to control the actual locking.
Facility for monitor object based locking.
void discardSolutions()
when advice is retracted explicitly, after removing the provision index entry we also need to re-proc...
static void * getBuffer(size_t)
allocate raw storage for a buffer holding the actual piece of advice.
void publishProvision(PointOfAdvice *)
when the Provision actually sets advice data, this is copied into an internal buffer within the Advic...
static void manageAdviceData(PointOfAdvice *, DeleterFunc *)
Store a descriptor record to take ownership of the given allocation.
static void releaseBuffer(void *, size_t)
void publishRequestBindingChange(HashVal)
Index datastructure for organising advice solutions.
void modifyRequest(HashVal oKey, POA &entry)
void addRequest(POA &entry)
void modifyProvision(POA const &oldRef, POA &newEntry)
void removeProvision(POA const &refEntry)
void addProvision(POA &entry)
void removeRequest(POA const &refEntry)
Basic (abstracted) view of an advice collaboration partner, as used internally by the AdviceSystem to...
void setSolution(PointOfAdvice *solution=0)
const PointOfAdvice * getSolution() const
the system-wide service to support the implementation of advice collaborations.
void manageAdviceData(PointOfAdvice *entry, DeleterFunc *how_to_delete)
void registerRequest(PointOfAdvice &req)
void publishProvision(PointOfAdvice *newProvision, const PointOfAdvice *previousProvision)
DelStash adviceDataRegistry_
void publishRequestBindingChange(PointOfAdvice &req, HashVal previous_bindingKey)
void * allocateBuffer(size_t siz)
low-level allocation of storage to hold advice data
void deregisterRequest(PointOfAdvice const &req)
void discardSolutions(const PointOfAdvice *existingProvision)
void discardEntry(PointOfAdvice *storedProvision)
Index< PointOfAdvice > index_
void releaseBuffer(void *buff, size_t)
Any copy and copy construction prohibited.
Collecting and finally triggering deleter functions.
Singleton services and Dependency Injection.
lumiera_err lumiera_error(void)
Get and clear current error state.
Lumiera error handling (C++ interface).
#define ERROR_LOG_AND_IGNORE(_FLAG_, _OP_DESCR_)
convenience shortcut for a sequence of catch blocks just logging and consuming an error.
Implementation datastructure for use by the Advice system.
This header is for including and configuring NoBug.
lib::Depend< AdviceSystem > aSys
hidden implementation-level access to the AdviceSystem
LumieraError< LERR_(FATAL), Logic > Fatal
Lumiera public interface.
OBJ * unConst(const OBJ *)
shortcut to save some typing when having to define const and non-const variants of member functions
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Marker types to indicate a literal string and a Symbol.
Object Monitor based synchronisation.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...