souffle
2.0.2-371-g6315b36
|
An Least-Recently-Used cache for arbitrary element types. More...
#include <CacheUtil.h>
Public Member Functions | |
void | access (const T &val) |
template<typename Op > | |
bool | any (const Op &op) const |
void | clear (const T &val=T()) |
template<typename Op > | |
bool | forEachInOrder (const Op &op) const |
Iterates over the elements within this cache in LRU order. More... | |
LRUCache (const T &val=T()) | |
Private Attributes | |
std::array< T, size > | entries |
std::size_t | first {0} |
std::size_t | last {size - 1} |
std::array< std::size_t, size > | post |
std::array< std::size_t, size > | priv |
An Least-Recently-Used cache for arbitrary element types.
Elements can be signaled to be accessed and iterated through in their LRU order.
Definition at line 39 of file CacheUtil.h.
|
inline |
|
inline |
Definition at line 76 of file CacheUtil.h.
|
inline |
Definition at line 142 of file CacheUtil.h.
|
inline |
Definition at line 69 of file CacheUtil.h.
|
inline |
Iterates over the elements within this cache in LRU order.
The operator is applied on each element. If the operation returns false, iteration is continued. If the operator return true, iteration is stopped – similar to the any operator.
op | the operator to be applied on every element |
Definition at line 131 of file CacheUtil.h.
Referenced by souffle::LRUCache< T, 1 >::forEachInOrder(), and souffle::LRUCache< T, 0 >::forEachInOrder().
|
private |
Definition at line 47 of file CacheUtil.h.
|
private |
Definition at line 53 of file CacheUtil.h.
|
private |
Definition at line 54 of file CacheUtil.h.
|
private |
Definition at line 51 of file CacheUtil.h.
|
private |
Definition at line 50 of file CacheUtil.h.