thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
DebugItem.h
1 // -*- C++ -*-
2 #ifndef ThePEG_DebugItem_H
3 #define ThePEG_DebugItem_H
4 //
5 // This is the declaration of the DebugItem class.
6 //
7 
8 #include "ThePEG/Config/ThePEG.h"
9 
10 namespace ThePEG {
11 
22 class DebugItem {
23 
24 public:
25 
34  DebugItem(string itemname, int level = 100);
36 
37 public:
38 
45  static void setDebugItem(string itemname, long after = 0);
46 
50  static void tic();
51 
55  operator bool () const {
56 #ifndef ThePEG_NO_DEBUG
57  return debug;
58 #else
59  return false;
60 #endif
61  }
62 
63 private:
64 
68  bool debug;
69 
73  static long & ticker();
74 
78  static multimap<string,DebugItem*> & items();
79 
84  static multimap<long,DebugItem*> & itemtics();
85 
90  static map<string,long> & nametics();
91 
92 private:
93 
98  DebugItem & operator=(const DebugItem &) = delete;
99 
100 };
101 
102 }
103 
104 #endif /* ThePEG_DebugItem_H */
static map< string, long > & nametics()
The DebugItem names registered together with the tic at which it should be turned on...
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
This is the main config header file for ThePEG.
DebugItem(string itemname, int level=100)
The only relevant constructor.
static multimap< string, DebugItem * > & items()
The DebugItem objects registered, indexed by their name.
The DebugItem class can be used to efficiently handle detailed debug options.
Definition: DebugItem.h:22
DebugItem & operator=(const DebugItem &)=delete
The assignment operator is private and must never be called.
bool debug
Set to true if debugging requested.
Definition: DebugItem.h:68
static void setDebugItem(string itemname, long after=0)
Switch on all DebugItem objects matching the given string.
static long & ticker()
Counter for number of tics.
static void tic()
Advance one tic, opssibly switching on more debug items.
static multimap< long, DebugItem * > & itemtics()
The DebugItem objects registered, indexed by the tic at which they should be turned on...