Class UID
Base class providing globally unique integer IDs. More...
#include <ID.h>
Inherited by the following classes: ObjectID, Scene
Public Functions
| Type | Name |
|---|---|
| int | GetObjectID () const Returns the unique ID of this object. |
| UID () Constructs a UID and assigns a unique ID. |
|
| virtual | ~UID () = default Virtual destructor for polymorphic use. |
Public Static Functions
| Type | Name |
|---|---|
| int | GetTotalAllocated () Returns total number of UIDs allocated. |
Detailed Description
UID generates sequential unique IDs for all instances. Each UID tracks a monotonically increasing ID counter to ensure no collisions.
Note:
Thread-safety: Not thread-safe. IDs should be allocated on main thread.
Note:
Lifetime: IDs are never reused, even after object destruction.
Public Functions Documentation
function GetObjectID
Returns the unique ID of this object.
inline int UID::GetObjectID () const
Returns:
Unique integer identifier
function UID
Constructs a UID and assigns a unique ID.
UID::UID ()
Note:
ID is assigned from global counter; increment is not atomic and UID is not thread-safe.
function ~UID
Virtual destructor for polymorphic use.
virtual UID::~UID () = default
Public Static Functions Documentation
function GetTotalAllocated
Returns total number of UIDs allocated.
static inline int UID::GetTotalAllocated ()
Returns:
Total allocation count (includes destroyed objects)
The documentation for this class was generated from the following file src/core/ID.h