|
OpenCBDC Transaction Processor
|
Thread-safe set with a maximum size. More...
#include <cache_set.hpp>

Public Member Functions | |
| cache_set ()=delete | |
| cache_set (size_t max_size) | |
| Constructor. | |
| template<typename T > | |
| auto | add (T &&val) -> bool |
| Adds a value to the set, evicting the oldest value if the set is full. | |
| auto | contains (const K &val) const -> bool |
| Determines whether a given value is present in the cache set. | |
Thread-safe set with a maximum size.
If full, inserting a new value will evict the oldest value.
| K | type of the values in the set. |
| H | hasher compatible with std::unordered_set. |
Definition at line 21 of file cache_set.hpp.
|
delete |
|
inlineexplicit |
Constructor.
| max_size | maximum number of elements in the set. |
Definition at line 27 of file cache_set.hpp.
|
inline |
Adds a value to the set, evicting the oldest value if the set is full.
| val | value to add. |
Definition at line 38 of file cache_set.hpp.
|
inlinenodiscard |
Determines whether a given value is present in the cache set.
| val | value to check. |
Definition at line 56 of file cache_set.hpp.