SST/macro
Static Public Member Functions | Static Public Attributes | Static Private Member Functions | List of all members
sprockit::debug Class Reference

#include <debug.h>

Collaboration diagram for sprockit::debug:
Collaboration graph

Static Public Member Functions

static void delete_statics ()
 
static void turn_off ()
 turn_off Turn off all debug printing for all flags More...
 
static void turn_on ()
 turn_on All debug flags that have been registered or previously turned on are reactivated More...
 
static void turn_off (debug_int &di)
 turn_off Turn off a specific type of debug output More...
 
static void turn_on (debug_int &di)
 turn_on Turn on a specific type of debug output More...
 
static void register_debug_slot (const std::string &str, debug_int *dint_ptr, const std::string &docstring)
 register_debug_slot Register a new debug slot that can be activated via the command line or input file flags More...
 
static void turn_on (const std::string &str)
 turn_on Another option for activating debug slots. More...
 
static void print_debug_string (const std::string &str, std::ostream &os=std::cout)
 print_debug_string Extra detail (prefix_fxn) can be added to each debug print. More...
 
static bool slot_active (const debug_int &allowed)
 slot_active Determine whether a debug slot is active. More...
 
static void print_all_debug_slots (std::ostream &os=std::cout)
 print_all_debug_slots Print all of the possible debug slots registered with the debug system and any associated doc strings More...
 

Static Public Attributes

static std::map< std::string, debug_int * > * debug_ints_
 
static std::map< std::string, std::string > * docstrings_
 
static debug_prefix_fxnprefix_fxn
 
static debug_int start_bitmask_
 The bitmask corresponding to all slots that were active at the beginning. More...
 
static debug_int current_bitmask_
 <= start_bitmask_ - some debug slots may have been selectively deactivated More...
 
static int num_bits_assigned
 The number of debug slots that have been assigned unique indices. More...
 

Static Private Member Functions

static void assign_slot (debug_int &dint)
 assign_slot If a given debug slot is activated, it must be assigned a unique integer index to allow bitwise AND checking of slots to see if they are active. More...
 

Detailed Description

Definition at line 103 of file debug.h.

Member Function Documentation

static void sprockit::debug::assign_slot ( debug_int dint)
staticprivate

assign_slot If a given debug slot is activated, it must be assigned a unique integer index to allow bitwise AND checking of slots to see if they are active.

This method should never be called by external code

Parameters
dintA reference to the integer that must be assigned a value
static void sprockit::debug::delete_statics ( )
static
static void sprockit::debug::print_all_debug_slots ( std::ostream &  os = std::cout)
static

print_all_debug_slots Print all of the possible debug slots registered with the debug system and any associated doc strings

Parameters
osThe stream to print to
static void sprockit::debug::print_debug_string ( const std::string &  str,
std::ostream &  os = std::cout 
)
static

print_debug_string Extra detail (prefix_fxn) can be added to each debug print.

This provides a wrapper function that prints a given string with all associated prefix metadata. This ALWAYS prints, and is not dependent on certain debug slots being active.

Parameters
strThe string to print after prefix metadata
osThe stream to print to
static void sprockit::debug::register_debug_slot ( const std::string &  str,
debug_int dint_ptr,
const std::string &  docstring 
)
static

register_debug_slot Register a new debug slot that can be activated via the command line or input file flags

Parameters
strThe unique string identifying the slot
dint_ptrA pointer to the debug integer that will be used for checking if debug printing is active. After registration, the debug integer pointed to will be updated.
docstringAn docstring describing the output produced by the debug when the debug slot is active

Referenced by sprockit::debug_register_slot::debug_register_slot().

static bool sprockit::debug::slot_active ( const debug_int allowed)
static

slot_active Determine whether a debug slot is active.

This is usually just a bitwise AND of the input parameter and a debug int with bits set to 1 for all the active slots

Parameters
allowedA debug integer indicating one or more possible debug slots
Returns
Whether the slots in the input parameter match any of the active debug slots
static void sprockit::debug::turn_off ( )
static

turn_off Turn off all debug printing for all flags

static void sprockit::debug::turn_off ( debug_int di)
static

turn_off Turn off a specific type of debug output

Parameters
diThe identifier for the debug printing to deactivate
static void sprockit::debug::turn_on ( )
static

turn_on All debug flags that have been registered or previously turned on are reactivated

static void sprockit::debug::turn_on ( debug_int di)
static

turn_on Turn on a specific type of debug output

Parameters
diThe identifier for the debug printing to activate
static void sprockit::debug::turn_on ( const std::string &  str)
static

turn_on Another option for activating debug slots.

Instead of activating via debug_int, activate via the associated string name

Parameters
strThe string name associated with a debug slot

Member Data Documentation

debug_int sprockit::debug::current_bitmask_
static

<= start_bitmask_ - some debug slots may have been selectively deactivated

Definition at line 116 of file debug.h.

std::map<std::string, debug_int*>* sprockit::debug::debug_ints_
static

Definition at line 106 of file debug.h.

std::map<std::string, std::string>* sprockit::debug::docstrings_
static

Definition at line 107 of file debug.h.

int sprockit::debug::num_bits_assigned
static

The number of debug slots that have been assigned unique indices.

Definition at line 118 of file debug.h.

debug_prefix_fxn* sprockit::debug::prefix_fxn
static

Definition at line 108 of file debug.h.

debug_int sprockit::debug::start_bitmask_
static

The bitmask corresponding to all slots that were active at the beginning.

Definition at line 114 of file debug.h.


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