mcrl2::utilities::fixed_size_cache =============================================================================== Include file: .. code-block:: c++ #include "mcrl2/utilities/fixed_size_cache.h .. cpp:class:: mcrl2::utilities::fixed_size_cache A cache keeps track of key-value pairs similar to a map. The difference is that a cache has (an optional) maximum size and a policy that determines what element gets evicted when the cache is full. Works with arbirary maps that implement the unordered_map interface. Public types ------------------------------------------------------------------------------- .. cpp:type:: mcrl2::utilities::fixed_size_cache::const_iterator typedef for :cpp:type:`typename Policy::map_type::const_iterator` .. cpp:type:: mcrl2::utilities::fixed_size_cache::iterator typedef for :cpp:type:`typename Policy::map_type::iterator` .. cpp:type:: mcrl2::utilities::fixed_size_cache::key_type typedef for :cpp:type:`typename Policy::key_type` Protected attributes ------------------------------------------------------------------------------- .. cpp:member:: Policy::map_type mcrl2::utilities::fixed_size_cache::m_map The underlying mapping from keys to their cached results. .. cpp:member:: std::size_t mcrl2::utilities::fixed_size_cache::m_maximum_size The maximum number of elements to cache. .. cpp:member:: Policy mcrl2::utilities::fixed_size_cache::m_policy The replacement policy for keys in the cache. Public member functions ------------------------------------------------------------------------------- .. cpp:function:: const_iterator begin() const .. cpp:function:: void clear() .. cpp:function:: std::size_t count(const key_type &key) const .. cpp:function:: std::pair emplace(Args &&... args) Stores the given key-value pair in the cache. Depending on the cache policy and capacity an existing element might be removed. .. cpp:function:: const_iterator end() const .. cpp:function:: iterator find(const key_type &key) .. cpp:function:: fixed_size_cache(std::size_t max_size=1024)