thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::DebugItem Class Reference

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.
 
DebugItemoperator= (const DebugItem &)=delete
 The assignment operator is private and must never be called.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DebugItem()

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.

Member Function Documentation

◆ itemtics()

static multimap< long, DebugItem * > & ThePEG::DebugItem::itemtics ( )
staticprivate

The DebugItem objects registered, indexed by the tic at which they should be turned on.

◆ operator bool()

ThePEG::DebugItem::operator bool ( ) const
inline

Cheap way of testing if debugging should be done.

Definition at line 55 of file DebugItem.h.

References debug.

◆ operator=()

DebugItem & ThePEG::DebugItem::operator= ( const DebugItem )
privatedelete

The assignment operator is private and must never be called.

In fact, it should not even be implemented.

◆ setDebugItem()

static void ThePEG::DebugItem::setDebugItem ( string  itemname,
long  after = 0 
)
static

Switch on all DebugItem objects matching the given string.

If after is positive delay the DebugItem until that number of tics. If the string is on the form "<name>=<int>" the integer will be taken as the delay.

Member Data Documentation

◆ debug

bool ThePEG::DebugItem::debug
private

Set to true if debugging requested.

Definition at line 68 of file DebugItem.h.

Referenced by operator bool().


The documentation for this class was generated from the following file: