template<class POA>
class lumiera::advice::Index< POA >
Index datastructure for organising advice solutions.
Based on two hashtables for advice provisions and requests, the index allows to add, modify and remove entities of these two kinds. Each of these mutating operations immediately re-computes the advice solutions and publishes the results by invoking the setSolution()
function on the corresponding PointOfAdvice entity.
- Note
- element identity is defined in terms of pointing to the same memory location of a POA (point of advice). Thus e.g. #hasProvision means this index holds an entry pointing to exactly this given data entity.
-
the implementation of modifying a Request entry explicitly relies on that definition of equality.
-
the diagnostic API is mainly intended for unit testing and not implemented with focus on performance.
- Exception safety
- Adding new registrations might throw error::Fatal or bad_alloc. The addition in this case has no effect and the index remains valid. The other mutating operations are NO_THROW, given that Binding::Matcher is a POD and std::vector fulfils the guarantee for POD content elements.
Definition at line 150 of file index.hpp.
validity self-check
Advice index self-verification: traverses the tables to check each entry is valid.
Moreover, when a advice request has a stored solution which points back into the current advice provisions, this solution will be re-computed with the current data to prove it's still valid.
- Note
- expensive operation
Definition at line 528 of file index.hpp.
Referenced by Index< lumiera::advice::PointOfAdvice >::clear().