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

The DebugItem class can be used to efficiently handle detailed debug options. More...

#include <DebugItem.h>

Public Member Functions

 operator bool () const
 Cheap way of testing if debugging should be done.
 
Standard constructors and destructors.
 DebugItem (string itemname, int level=100)
 The only relevant constructor. More...
 

Static Public Member Functions

static void setDebugItem (string itemname, long after=0)
 Switch on all DebugItem objects matching the given string. More...
 
static void tic ()
 Advance one tic, opssibly switching on more debug items.
 

Private Member Functions

DebugItemoperator= (const DebugItem &)=delete
 The assignment operator is private and must never be called. More...
 

Static Private Member Functions

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. More...
 
static map< string, long > & nametics ()
 The DebugItem names registered together with the tic at which it should be turned on.
 

Private Attributes

bool debug
 Set to true if debugging requested.
 

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=()

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.


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