hpx/cache/entries/size_entry.hpp¶
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace
hpx
-
namespace
util
-
namespace
cache
-
namespace
entries
-
class
size_entry
¶ - #include <hpx/cache/entries/size_entry.hpp>
The size_entry type can be used to store values in a cache which have a size associated (such as files, etc.). Using this type as the cache’s entry type makes sure that the entries with the biggest size are discarded from the cache first.
- Note
The size_entry conforms to the CacheEntry concept.
- Note
This type can be used to model a ‘discard smallest first’ cache policy if it is used with a std::greater as the caches’ UpdatePolicy (instead of the default std::less).
- Template Parameters
Value
: The data type to be stored in a cache. It has to be default constructible, copy constructible and less_than_comparable.Derived
: The (optional) type for which this type is used as a base class.
Public Functions
-
size_entry
()¶ Any cache entry has to be default constructible.
-
size_entry
(Value const &val, std::size_t size = 0)¶ Construct a new instance of a cache entry holding the given value.
Private Types
-
using
derived_type
= typename detail::size_derived<Value, Derived>::type¶
-
using
base_type
= entry<Value, derived_type>¶
Friends
-
friend constexpr bool
operator<
(size_entry const &lhs, size_entry const &rhs)¶ Compare the ‘age’ of two entries. An entry is ‘older’ than another entry if it has a bigger size.
-
class
-
namespace
-
namespace
-
namespace