Cachemere
Modular Caching Library for C++
measurement.h
1 #ifndef CACHEMERE_MEASUREMENT_H
2 #define CACHEMERE_MEASUREMENT_H
3 
4 #include <cstdint>
5 
8 
10 template<typename T> struct Size {
11  template<typename V> size_t operator()(const V& object) const;
12 };
13 
15 template<typename T> struct SizeOf {
16  template<typename V> size_t operator()(const V& object) const;
17 };
18 
20 template<typename T> struct CapacityDynamicallyAllocated {
21 public:
22  template<typename V> size_t operator()(const V& object) const;
23 
24 private:
25  [[nodiscard]] size_t round_up(const size_t value) const;
26 };
27 
28 } // namespace cachemere::measurement
29 
30 #include "measurement.hpp"
31 
32 #endif
cachemere::measurement::Size
Get the size of an object via a user-defined size() method.
Definition: measurement.h:10
cachemere::measurement
Utilities for measuring cached items.
Definition: measurement.h:7
cachemere::measurement::CapacityDynamicallyAllocated
Get the size of an object via a user-defined capacity() method.
Definition: measurement.h:20
cachemere::measurement::SizeOf
Get the size of an object via sizeof().
Definition: measurement.h:15