nux-1.16.0
nux::Trackable Class Reference

Base class of heap allocated objects. More...

#include <NuxCore/Object.h>

Inheritance diagram for nux::Trackable:
nux::Introspectable nux::Object nux::ActionItem nux::CachedResourceData nux::FontTexture nux::InitiallyUnownedObject nux::IOpenGLResource nux::MenuBarItem nux::ResourceData nux::Timeline

List of all members.

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

Detailed Description

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.

Definition at line 66 of file Object.h.


Member Function Documentation

bool nux::Trackable::Dispose ( ) [virtual]

Destroy and object that has a floating reference.

Returns:
True if the object has been destroyed

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.

Returns:
The size 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().

Returns:
True if the object was not owned previously

Reimplemented in nux::Object.

Definition at line 105 of file Object.cpp.

  {
    return false;
  }
bool nux::Trackable::UnReference ( ) [virtual]

Decrease the reference count.

Returns:
True if the object has been destroyed

Reimplemented in nux::Object.

Definition at line 100 of file Object.cpp.

  {
    return false;
  }

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends