mCRL2
Loading...
Searching...
No Matches
rewrite_statistics.h
Go to the documentation of this file.
1// Author(s): Wieger Wesselink
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/// \file mcrl2/data/detail/rewrite_statistics.h
10/// \brief Global variable for collecting rewrite statistics.
11
12#ifndef MCRL2_DATA_DETAIL_REWRITE_STATISTICS_H
13#define MCRL2_DATA_DETAIL_REWRITE_STATISTICS_H
14
15#include "mcrl2/utilities/logger.h"
16
17namespace mcrl2::data::detail
18{
19
20template <class T> // note, T is only a dummy
22{
23 static std::size_t rewrite_count;
24};
25
26template <class T>
28
29inline
31{
32 return rewrite_statistics<int>::rewrite_count;
33}
34
35inline
37{
38 mCRL2log(log::verbose) << "rewrite count = " << rewrite_count() << std::endl;
39}
40
41inline
43{
44 rewrite_statistics<int>::rewrite_count++;
45 if (rewrite_count() % 10000 == 0)
46 {
48 }
49}
50
51} // namespace mcrl2::data::detail
52
53#endif // MCRL2_DATA_DETAIL_REWRITE_STATISTICS_H
logger(const log_level_t l)
Default constructor.
Definition logger.h:163
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
Definition logger.h:393
std::size_t rewrite_count()
@ verbose
Definition logger.h:36
std::size_t operator()(const std::vector< X > &v) const