CObject
|
Base class. More...
#include <Class.h>
Public Member Functions | |
const struct CObject_VTable * | CObject_GetVTable () |
struct CObject * | CObject_Constructor (struct CObject *self) |
void | CObject_Destroy (struct CObject *self) |
void | CObject_SetFree (struct CObject *self, CFreeType free_method) |
Data Fields | |
struct CClass | _cc |
const void * | _vt |
CFreeType | CObject_Free |
This is the base Class. All classes inherit from it. It must be the first member of any class' structure declaration (unless they're inheriting from from a user defined class, in that case, the user defined class must be the first member).
Constructor. To construct an instance of struct CObject, call this method on it. This method has a macro shortcut, CObject(), to reduce the amount of typing for creating an instance of struct CObject.
self | The instance of struct CObject to construct |
void CObject_Destroy | ( | struct CObject * | self | ) |
Destructor. This is the destructor for all objects. Its polymorphic, meaning A reference to any class instance / interface can be given and the entire object will be destroyed. If a memory free method was set with CObject_SetFree(), CDynamic(), or CFreeWith(), that method will be called at the end of destruction. This method has a macro short cut, CDestroy(), to reduce the amount of typing for destroying an object.
self | The object to destroy |
void CObject_SetFree | ( | struct CObject * | self, |
CFreeType | free_method | ||
) |
Set a memory free method to be called at the end of destruction.
self | The object to have a memory free method set. |
free_method | The method to call when destruction finishes. Has declaration void(*)( void* ). |