The DebugItem class can be used to efficiently handle detailed debug options. More...
#include <DebugItem.h>
Standard constructors and destructors. | |
bool | debug |
Set to true if debugging requested. | |
DebugItem (string itemname, int level=100) | |
The only relevant constructor. | |
operator bool () const | |
Cheap way of testing if debugging should be done. | |
static void | setDebugItem (string itemname, long after=0) |
Switch on all DebugItem objects matching the given string. | |
static void | tic () |
Advance one tic, opssibly switching on more debug items. | |
static long & | ticker () |
Counter for number of tics. | |
static multimap< string, DebugItem * > & | items () |
The DebugItem objects registered, indexed by their name. | |
static multimap< long, DebugItem * > & | itemtics () |
The DebugItem objects registered, indexed by the tic at which they should be turned on. | |
static map< string, long > & | nametics () |
The DebugItem names registered together with the tic at which it should be turned on. | |
DebugItem & | operator= (const DebugItem &)=delete |
The assignment operator is private and must never be called. | |
The DebugItem class can be used to efficiently handle detailed debug options.
The actual objects are used anywhere in a function where optional debugging should be done. At that point a static object of DebugItem should be constructed giving a name to be used (it should be static to ensure that the initialization is only done once). After that the object is automatically cast to a bool indicating whether or not debugging has been requested for this item.
Definition at line 22 of file DebugItem.h.
ThePEG::DebugItem::DebugItem | ( | string | itemname, |
int | level = 100 |
||
) |
The only relevant constructor.
The string should typically be on the form "namspace::class::function". If the Debug::level is larger than or equal to the given level this DebugItem will be turned on.
|
staticprivate |
The DebugItem objects registered, indexed by the tic at which they should be turned on.
|
inline |
Cheap way of testing if debugging should be done.
Definition at line 55 of file DebugItem.h.
References debug.
The assignment operator is private and must never be called.
In fact, it should not even be implemented.
|
static |
|
private |
Set to true if debugging requested.
Definition at line 68 of file DebugItem.h.
Referenced by operator bool().