oILAB
|
A class template that implements a counter of the number of instances of Derived type that are created at runtime. It also provides a unique increasing static identifier (sID) for each instance. More...
#include <StaticID.h>
Public Member Functions | |
StaticID () | |
StaticID (const StaticID &) | |
Static Public Member Functions | |
static size_t | nextID () |
static size_t & | get_count () |
static void | set_count (const size_t &newCount) |
static void | set_increment (const size_t &newIncrement) |
Data Fields | |
const size_t | sID |
The static ID of this. | |
Static Private Attributes | |
static size_t | increment = 1 |
static size_t | count = 0 |
static bool | count_used = false |
A class template that implements a counter of the number of instances of Derived type that are created at runtime. It also provides a unique increasing static identifier (sID) for each instance.
Example:
Output:
Definition at line 26 of file StaticID.h.
|
inline |
Definition at line 42 of file StaticID.h.
|
inline |
Definition at line 49 of file StaticID.h.
|
inlinestatic |
Definition at line 61 of file StaticID.h.
|
inlinestatic |
Definition at line 56 of file StaticID.h.
|
inlinestatic |
Definition at line 67 of file StaticID.h.
|
inlinestatic |
Definition at line 78 of file StaticID.h.
|
staticprivate |
Definition at line 33 of file StaticID.h.
|
staticprivate |
Definition at line 34 of file StaticID.h.
|
staticprivate |
Definition at line 30 of file StaticID.h.
const size_t gbLAB::StaticID< Derived >::sID |
The static ID of this.
Definition at line 39 of file StaticID.h.