Mix-in class for counting creation and destruction of objects. More...
#include "utl/CountedObject.h"
Public Types | |
typedef T | CountedType |
The type of the object we are counting. More... | |
typedef CountedObjectRegistry::Counter | Counter |
The (integer) type used to hold the counter. More... | |
Static Public Member Functions | |
static Counter | GetObjectsAssigned () |
static Counter | GetObjectsCopied () |
static Counter | GetObjectsCreated () |
number of calls to the constructor More... | |
static Counter | GetObjectsDestroyed () |
number of calls to the destructor More... | |
static Counter | GetObjectsExisting () |
difference of number of calls to constructor and destructor More... | |
Protected Member Functions | |
CountedObject () | |
CountedObject (const CountedObject &) | |
CountedObject & | operator= (const CountedObject &) |
virtual | ~CountedObject () |
Static Private Attributes | |
static Counter | fgObjectsAssigned = 0 |
static Counter | fgObjectsCopied = 0 |
static Counter | fgObjectsCreated = 0 |
static Counter | fgObjectsDestroyed = 0 |
Mix-in class for counting creation and destruction of objects.
This template adds two global, static variables per type that is counted to count the calls to the constructor and destructor.
To instrument the code using this class, you inherit privately from this class
Definition at line 30 of file CountedObject.h.
typedef T utl::CountedObject< T >::CountedType |
The type of the object we are counting.
Definition at line 33 of file CountedObject.h.
typedef CountedObjectRegistry::Counter utl::CountedObject< T >::Counter |
The (integer) type used to hold the counter.
Definition at line 35 of file CountedObject.h.
|
inlineprotected |
Definition at line 52 of file CountedObject.h.
|
inlineprotected |
Definition at line 58 of file CountedObject.h.
|
inlineprotectedvirtual |
Definition at line 65 of file CountedObject.h.
|
inlinestatic |
Definition at line 48 of file CountedObject.h.
|
inlinestatic |
Definition at line 45 of file CountedObject.h.
|
inlinestatic |
number of calls to the constructor
Definition at line 38 of file CountedObject.h.
|
inlinestatic |
number of calls to the destructor
Definition at line 40 of file CountedObject.h.
|
inlinestatic |
difference of number of calls to constructor and destructor
Definition at line 42 of file CountedObject.h.
|
inlineprotected |
Definition at line 67 of file CountedObject.h.
|
staticprivate |
Definition at line 74 of file CountedObject.h.
Referenced by utl::CountedObject< Foo >::GetObjectsAssigned(), and utl::CountedObject< Foo >::operator=().
|
staticprivate |
Definition at line 73 of file CountedObject.h.
Referenced by utl::CountedObject< Foo >::CountedObject(), and utl::CountedObject< Foo >::GetObjectsCopied().
|
staticprivate |
Definition at line 71 of file CountedObject.h.
Referenced by utl::CountedObject< Foo >::CountedObject(), utl::CountedObject< Foo >::GetObjectsCreated(), and utl::CountedObject< Foo >::GetObjectsExisting().
|
staticprivate |
Definition at line 72 of file CountedObject.h.
Referenced by utl::CountedObject< Foo >::GetObjectsDestroyed(), utl::CountedObject< Foo >::GetObjectsExisting(), and utl::CountedObject< Foo >::~CountedObject().