101 typedef void (DeleterFunc)(
void*);
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");
160 releaseBuffer (
void* buff,
size_t)
162 delete[] (
char*)buff;
169 adviceDataRegistry_.manage (entry, how_to_delete);
178 adviceDataRegistry_.kill (storedProvision);
198 index_.addRequest (req);
207 index_.removeRequest (req);
213 WARN (library,
"Problems on deregistration of advice request: %s", errID.c());
223 if (!previousProvision && newProvision)
224 index_.addProvision (*newProvision);
226 if (previousProvision && newProvision)
227 index_.modifyProvision (*previousProvision, *newProvision);
229 if (previousProvision && !newProvision)
230 index_.removeProvision (*previousProvision);
232 discardEntry (unConst(previousProvision));
240 if (existingProvision)
241 index_.removeProvision (*existingProvision);
243 discardEntry (unConst(existingProvision));
273 return aSys().allocateBuffer(siz);
278 AdviceLink::releaseBuffer (
void* buff,
size_t siz)
280 aSys().releaseBuffer(buff, siz);
294 aSys().manageAdviceData (entry,how_to_delete);
316 this->setSolution (newProvision);
318 aSys().publishProvision (newProvision, previousProvision);
334 this->setSolution ( NULL );
335 aSys().discardSolutions (existingProvision);
340 AdviceLink::publishRequestBindingChange(
HashVal previous_bindingKey)
342 aSys().publishRequestBindingChange (*
this, previous_bindingKey);
347 AdviceLink::registerRequest()
349 aSys().registerRequest (*
this);
354 AdviceLink::deregisterRequest()
356 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)