SmallFifoMap.hpp
Store key value pairs in a fixed-sized array, bumping out the oldest value when full. Optimized for small N. Requires N < 256.
-
template<class Key, class Value, size_t N>
class SmallFifoMap - #include <SmallFifoMap.hpp>
Public Types
Public Functions
-
inline const_iterator begin() const
-
inline const_iterator cbegin() const
-
inline const_iterator end() const
-
inline const_iterator cend() const
-
inline size_t size() const
How many key-value pairs are in the cache?
-
inline bool empty() const
Does the cache contain any key-value pairs?
-
inline void clear()
Clear the cache.
-
inline const_iterator find(const Key &key) const
Find key-value pair iterator in cache.
-
inline Value *get(const Key &key)
Get corresponding value from cache. Return nullptr if key not in cache.
Public Static Functions
-
static inline constexpr size_t capacity()
How many key-value pairs can the cache contain?
-
inline const_iterator begin() const