Manages storage of edges of the edge_container. More...
Public Member Functions | |
edge_storage & | operator= (edge_storage const &)=delete |
edge_storage (edge_storage const &)=delete | |
edge_entry_t * | lookup_ptr (index_type tid) const |
Search for entry with key tid . If found, return a pointer else return a nullptr. | |
edge_entry_t & | lookup_expect (index_type tid) |
Search for entry with key tid . The entry is expected to exist; assert if it is not found. Return a reference to the entry. | |
bool | contains (index_type tid) const |
Returns true if there is an entry for task tid in the value cache. | |
bool | empty (void) const |
void | erase (edge_entry_t &entry_ref) const |
void | clear (void) |
bool | insert (edge_entry_t &entry_ref) |
template<typename EntryFactory > | |
edge_entry_t & | lookup_or_insert (const index_type tid, EntryFactory factory) |
Check if entry exists for given task id and create one if it doesn't. Returns a reference to the entry. | |
template<typename Functor > | |
void | for_each (Functor f) const |
Apply functor on all entries in the value cache. | |
Public Types | |
using | index_type = std::size_t |
The task identifier type used by the PARAGRAPH. | |
using | edge_entry_t = detail::edge_entry_base |
The edge entry type held by the value cache. | |
Protected Member Functions | |
void | check_increase_size (void) const |
Called by edge_container methods that increase the number of entries stored in the local cache. If load factor is 1, resize by a power of two. | |
Manages storage of edges of the edge_container.
Callers know the intrusive nature of entries (i.e., they are responsible for allocation and deallocation of entries), but the exact storage container (e.g., ordered_set vs unordered_set) is abstracted. Furthermore, the interface of the underlying Boost.Intrusive container is restricted to not allow access via iterators. This allows operations that invalidate iterators such as rehashing to occur without other parts of the stack needing to know.