110 typedef void (DeleterFunc)(
void*);
136 TRACE (library,
"Initialising Advice Index tables.");
141 TRACE (library,
"Shutting down Advice system.");
158 try {
return new char[siz]; }
160 catch(std::bad_alloc&)
162 throw error::Fatal(
"Unable to store Advice due to memory exhaustion");
169 releaseBuffer (
void* buff,
size_t)
171 delete[] (
char*)buff;
178 adviceDataRegistry_.manage (entry, how_to_delete);
187 adviceDataRegistry_.kill (storedProvision);
207 index_.addRequest (req);
216 index_.removeRequest (req);
222 WARN (library,
"Problems on deregistration of advice request: %s", errID.c());
232 if (!previousProvision && newProvision)
233 index_.addProvision (*newProvision);
235 if (previousProvision && newProvision)
236 index_.modifyProvision (*previousProvision, *newProvision);
238 if (previousProvision && !newProvision)
239 index_.removeProvision (*previousProvision);
241 discardEntry (unConst(previousProvision));
249 if (existingProvision)
250 index_.removeProvision (*existingProvision);
252 discardEntry (unConst(existingProvision));
282 return aSys().allocateBuffer(siz);
287 AdviceLink::releaseBuffer (
void* buff,
size_t siz)
289 aSys().releaseBuffer(buff, siz);
303 aSys().manageAdviceData (entry,how_to_delete);
325 this->setSolution (newProvision);
327 aSys().publishProvision (newProvision, previousProvision);
343 this->setSolution ( NULL );
344 aSys().discardSolutions (existingProvision);
349 AdviceLink::publishRequestBindingChange(
HashVal previous_bindingKey)
351 aSys().publishRequestBindingChange (*
this, previous_bindingKey);
356 AdviceLink::registerRequest()
358 aSys().registerRequest (*
this);
363 AdviceLink::deregisterRequest()
365 aSys().deregisterRequest (*
this);
Facility for monitor object based locking.
the system-wide service to support the implementation of advice collaborations.
void * allocateBuffer(size_t siz)
low-level allocation of storage to hold advice data
Basic (abstracted) view of an advice collaboration partner, as used internally by the AdviceSystem to...
#define ERROR_LOG_AND_IGNORE(_FLAG_, _OP_DESCR_)
convenience shortcut for a sequence of catch blocks just logging and consuming an error...
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
Implementation datastructure for use by the Advice system.
lib::Depend< AdviceSystem > aSys
hidden implementation-level access to the AdviceSystem
static void manageAdviceData(PointOfAdvice *, DeleterFunc *)
Store a descriptor record to take ownership of the given allocation.
This header is for including and configuring NoBug.
Access point to singletons and other kinds of dependencies designated by type.
Collecting and finally triggering deleter functions.
Object Monitor based synchronisation.
Derived specific exceptions within Lumiera's exception hierarchy.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Expecting Advice and giving Advice: a cross-cutting collaboration of loosely coupled participants...
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...
void discardSolutions()
when advice is retracted explicitly, after removing the provision index entry we also need to re-proc...
lumiera_err lumiera_error(void)
Get and clear current error state.
void publishProvision(PointOfAdvice *)
when the Provision actually sets advice data, this is copied into an internal buffer within the Advic...
Manage a collection of deleter functions.
Singleton services and Dependency Injection.
Lumiera error handling (C++ interface).
size_t HashVal
a STL compatible hash value
Lumiera public interface.
static void * getBuffer(size_t)
allocate raw storage for a buffer holding the actual piece of advice.
void modifyRequest(HashVal oKey, POA &entry)
Index datastructure for organising advice solutions.
void discardEntry(PointOfAdvice *storedProvision)