RioEngine  0.1
My first attempt to create a 3D WYSIWYG Game Engine
CObject Class Reference

#include <cobject.h>

Inheritance diagram for CObject:
btCustomTransform CAction CActionManager CArray< T > CArray< btVector3 > CArray< CLBindVertexInput > CArray< CLInstanceGeometry > CArray< CLInstanceMaterial > CArray< CLPolygon > CArray< CLTriangles > CArray< int > CArray< TextureCoord > CAutoreleasePool CBulletProperties CCamera CDirector CGameScene CLBindVertexInput CLEffect CLGeometry CLInstanceGeometry CLInstanceMaterial CLMaterial CLMesh CLNode CLPhong CLPhongChild CLPolygon CLScene CLTriangles CSingleton< T > CSoundPlayer IUndoableAction Math::MatrixStack QProperty Transform UndoableActionsManager

Public Member Functions

 CObject ()
 
 CObject (const CObject &object)
 
CObjectoperator= (const CObject &object)
 
CObjectretain ()
 
unsigned int release () const
 
CObjectautorelease ()
 
unsigned int retainCount () const
 
bool isValidCObject () const
 
virtual ~CObject ()
 

Static Public Member Functions

static void safeRetain (void *pointer)
 
template<class T >
static void safeRelease (T *pointer)
 
template<class T >
static void safeReleaseArray (T *array)
 
static void safeRelease (const char *pointer)
 

Protected Member Functions

virtual void copyValuesFromObject (const CObject &object)
 

Detailed Description

CObject is the base class for every custom type in RioEngine

You should never call 'delete' on any CObject because another object might be referencing it. By convention you should always release a CObject by calling its release() method or using the 'SAFE_RELEASE(x)' macro.

Definition at line 46 of file cobject.h.

Constructor & Destructor Documentation

CObject::CObject ( )

Default constructor. Don't forget to call it when subclassing!.

Definition at line 37 of file cobject.cpp.

CObject::CObject ( const CObject object)
explicit

Copy constructor. Don't forget to call it when subclassing!.

Definition at line 44 of file cobject.cpp.

CObject::~CObject ( )
virtual

Destructor declared as virtual in order to force it to be called when deallocating any subclass of CObject.

Definition at line 134 of file cobject.cpp.

Member Function Documentation

CObject * CObject::autorelease ( )

By calling this method the object will be added to the current CAutoreleasePool and will be released in a later time.

Definition at line 87 of file cobject.cpp.

void CObject::copyValuesFromObject ( const CObject object)
protectedvirtual

Self-explanatory. Don't forget to override it! (if needed)

Definition at line 60 of file cobject.cpp.

bool CObject::isValidCObject ( ) const

Returns true only if this object inherits from CObject.

Definition at line 100 of file cobject.cpp.

CObject & CObject::operator= ( const CObject object)

Definition at line 51 of file cobject.cpp.

unsigned int CObject::release ( ) const

Decrements the object's reference count by 1

Definition at line 74 of file cobject.cpp.

CObject * CObject::retain ( )

Increments the object's reference count by 1

Definition at line 66 of file cobject.cpp.

unsigned int CObject::retainCount ( ) const

Returns the number that indicates how many times the object has been referenced by other objects.

Definition at line 94 of file cobject.cpp.

template<class T >
static void CObject::safeRelease ( T *  pointer)
inlinestatic

Releases the pointer's object only if it inherits from CObject. Otherwise the pointer gets deallocated

Definition at line 115 of file cobject.h.

static void CObject::safeRelease ( const char *  pointer)
inlinestatic

Definition at line 138 of file cobject.h.

template<class T >
static void CObject::safeReleaseArray ( T *  array)
inlinestatic

Definition at line 130 of file cobject.h.

static void CObject::safeRetain ( void *  pointer)
inlinestatic

Retains the pointer's object only if it inherits from CObject.

Definition at line 98 of file cobject.h.


The documentation for this class was generated from the following files: