tudocomp
– The TU Dortmund Compression Framework
StatPhaseDummy.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstring>
4 #include <ctime>
5 
6 #include <tudocomp_stat/Json.hpp>
7 
9 
10 namespace tdc {
11 
12 // same public interface as StatPhase, but doesn't do anything
13 // used for STATS_DISABLED
14 class StatPhaseDummy {
15 public:
16  inline StatPhaseDummy() {
17  }
18 
19  template<typename F>
20  inline static auto wrap(const char* title, F func) ->
21  typename std::result_of<F(StatPhaseDummy&)>::type {
22 
23  StatPhaseDummy phase;
24  return func(phase);
25  }
26 
27  template<typename F>
28  inline static auto wrap(const char* title, F func) ->
29  typename std::result_of<F()>::type {
30 
31  return func();
32  }
33 
34  inline static void track_alloc(size_t bytes) {
35  }
36 
37  inline static void track_free(size_t bytes) {
38  }
39 
40  inline static void pause_tracking() {
41  }
42 
43  inline static void resume_tracking() {
44  }
45 
46  template<typename T>
47  inline static void log(const char* key, const T& value) {
48  }
49 
50  inline StatPhaseDummy(const char* title) {
51  }
52 
53  inline StatPhaseDummy(const std::string& title) {
54  }
55 
56  inline ~StatPhaseDummy() {
57  }
58 
59  inline void split(const char* new_title) {
60  }
61 
62  inline void split(const std::string& new_title) {
63  }
64 
65  template<typename T>
66  inline void log_stat(const char* key, const T& value) {
67  }
68 
69  inline json::Object to_json() {
70  return json::Object();
71  }
72 };
73 
74 }
75 
77 
Contains the text compression and encoding framework.
Definition: namespaces.hpp:11