Thing Class Reference

#include <Thing.h>

Inheritance diagram for Thing:
Inheritance graph
[legend]

List of all members.

Public Types

typedef void(*  InfoCB )(const Thing *)

Public Member Functions

void  getTypeName (awString::CString &name) const

Static Public Member Functions

static bool  captureStackTraces (bool state)
  Turn on/off stack trace back capturing.
static void  registerInfoCallback (InfoCB)
static int  getNumberOfActiveThings ()
  This is a debugging aid for the reference counting.
static void  printActiveThings (const awString::CString &what)
  Only works in DEBUG (or !NDEBUG).
static void  printActiveThingsSummary ()
  Only works in DEBUG (or !NDEBUG).
static void  printActiveThingsSummaryFile (FILE *fp)
static void  pushThingTracker ()
  To track allocations and deletions during a particular period of time you can push the current tracker onto a stack and begin tracking all new allocations.
static void  popThingTracker (bool dump=true, bool details=false)
static void  decrementNumberOfActiveThings ()
  Very rarely, there will be an entity created in the system which we do not to consider in the entity total.

Protected Member Functions

  Thing ()
virtual  ~Thing ()

Member Typedef Documentation

typedef void(* InfoCB)(const Thing *)

Constructor & Destructor Documentation

Thing ( ) [protected]
virtual ~Thing ( ) [protected, virtual]

Member Function Documentation

void getTypeName ( awString::CString &  name ) const
static bool captureStackTraces ( bool  state ) [static]

Turn on/off stack trace back capturing.

This is expensive!! Returns the previous capture state.

static void registerInfoCallback ( InfoCB  ) [static]
static int getNumberOfActiveThings ( ) [static]

This is a debugging aid for the reference counting.

It keeps track of how many active entities there are in the system. It is typically used by the unit tests, to ensure all entities have been destroyed between independent unit test runs

static void printActiveThings ( const awString::CString &  what ) [static]

Only works in DEBUG (or !NDEBUG).

Print all things of the given type. The string expected is the one returned by typeid(*thing).name(). For example, for awSupport::Node, you'd use "class awSupport::Node".

static void printActiveThingsSummary ( ) [static]

Only works in DEBUG (or !NDEBUG).

Prints the counts of active things grouped by type.

static void printActiveThingsSummaryFile ( FILE *  fp ) [static]
static void pushThingTracker ( ) [static]

To track allocations and deletions during a particular period of time you can push the current tracker onto a stack and begin tracking all new allocations.

When you pop the tracker off you can dump out any things that were not freed during that period. Unreleased items are added to the next stack level after a pop operation so they can still be reported on exit.

static void popThingTracker ( bool  dump = true,
bool  details = false 
) [static]
static void decrementNumberOfActiveThings ( ) [static]

Very rarely, there will be an entity created in the system which we do not to consider in the entity total.

The most useful use for the entity total is to ensure there are no memory leaks in the unit tests. If the unit tests can be leak free, there is a good chance our model is sound. A few entities are created in static data space, and are not destroyed until the program terminates. Since these entites are not destroyed between the unit tests, their existence messes with the total. On those occasions, and ONLY on those occasions, you can call this to fix the count.


Thing Thing Thing Thing Thing Thing Thing Thing Thing Thing
Thing Thing Thing Thing Thing Thing Thing Thing Thing Thing