nux-1.16.0
|
Base class of heap allocated objects. More...
#include <NuxCore/Object.h>
Public Member Functions | |
NUX_DECLARE_ROOT_OBJECT_TYPE (Trackable) | |
bool | OwnsTheReference () |
Test if object reference is owned. | |
bool | IsHeapAllocated () |
Test if object was allocated dynamically. | |
bool | IsDynamic () const |
Test if object was allocated dynamically. | |
virtual bool | Reference () |
Increase the reference count. | |
virtual bool | UnReference () |
Decrease the reference count. | |
virtual bool | SinkReference () |
Mark the object as owned. | |
virtual bool | Dispose () |
Destroy and object that has a floating reference. | |
virtual int | GetObjectSize () |
Return the size of allocated for this object. | |
Static Public Member Functions | |
static std::new_handler | set_new_handler (std::new_handler handler) |
static void * | operator new (size_t size) |
static void * | operator new (size_t size, void *ptr) |
static void | operator delete (void *ptr) |
Protected Member Functions | |
void | SetOwnedReference (bool b) |
Protected Attributes | |
int | _heap_allocated |
Base class of heap allocated objects.
Trackable does not implement reference counting. It only defines the API. It is up to the class that inherit from Trackable to implement the reference counting.
bool nux::Trackable::Dispose | ( | ) | [virtual] |
Destroy and object that has a floating reference.
Reimplemented in nux::Object.
Definition at line 110 of file Object.cpp.
{ return false; }
int nux::Trackable::GetObjectSize | ( | ) | [virtual] |
Return the size of allocated for this object.
Definition at line 215 of file Object.cpp.
{
return _size_of_this_object;
}
bool nux::Trackable::SinkReference | ( | ) | [virtual] |
Mark the object as owned.
If this object is not owned, calling SinkReference() as the same effect as calling Reference().
Reimplemented in nux::Object.
Definition at line 105 of file Object.cpp.
{ return false; }
bool nux::Trackable::UnReference | ( | ) | [virtual] |
Decrease the reference count.
Reimplemented in nux::Object.
Definition at line 100 of file Object.cpp.
{ return false; }