mCRL2
Loading...
Searching...
No Matches
cache_metric.h
Go to the documentation of this file.
1// Author(s): Maurice Laveaux
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
9
10#ifndef MCRL2_UTILITIES_CACHE_METRIC_H
11#define MCRL2_UTILITIES_CACHE_METRIC_H
12
13#include <cstddef>
14#include <string>
15
16namespace mcrl2
17{
18namespace utilities
19{
20
23{
24public:
26 void hit() { ++m_hit_count; }
27
29 void miss() { ++m_miss_count; }
30
32 void reset()
33 {
34 m_hit_count = 0;
35 m_miss_count = 0;
36 }
37
39 std::string message() const;
40
41private:
42 std::size_t m_hit_count = 0;
43 std::size_t m_miss_count = 0;
44
45};
46
47} // namespace utilities
48} // namespace mcrl2
49
50
51#endif // MCRL2_UTILITIES_CACHE_METRIC_H
A helper class to keep track of the number of hits and misses for cache-like data structures.
void reset()
Resets the cache counters.
void miss()
Should be called when searching the cache was a miss.
void hit()
Should be called when searching the cache was a hit.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72