thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
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
9
10namespace ThePEG {
11
22class DebugItem {
23
24public:
25
34 DebugItem(string itemname, int level = 100);
36
37public:
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
63private:
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
92private:
93
98 DebugItem & operator=(const DebugItem &) = delete;
99
100};
101
102}
103
104#endif /* ThePEG_DebugItem_H */
This is the main config header file for ThePEG.
The DebugItem class can be used to efficiently handle detailed debug options.
Definition: DebugItem.h:22
bool debug
Set to true if debugging requested.
Definition: DebugItem.h:68
static multimap< long, DebugItem * > & itemtics()
The DebugItem objects registered, indexed by the tic at which they should be turned on.
static void tic()
Advance one tic, opssibly switching on more debug items.
static multimap< string, DebugItem * > & items()
The DebugItem objects registered, indexed by their name.
static void setDebugItem(string itemname, long after=0)
Switch on all DebugItem objects matching the given string.
DebugItem & operator=(const DebugItem &)=delete
The assignment operator is private and must never be called.
DebugItem(string itemname, int level=100)
The only relevant constructor.
static long & ticker()
Counter for number of tics.
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