CObject
CObject Struct Reference

Base class. More...

#include <Class.h>

Public Member Functions

const struct CObject_VTableCObject_GetVTable ()
 
struct CObjectCObject_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
 

Detailed Description

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).

Member Function Documentation

struct CObject * CObject_Constructor ( struct CObject self)
Class Constructor

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.

Parameters
selfThe instance of struct CObject to construct
Returns
Returns a pointer the constructed instance, the same as the input argument.
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.

Parameters
selfThe 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.

Parameters
selfThe object to have a memory free method set.
free_methodThe method to call when destruction finishes. Has declaration void(*)( void* ).

The documentation for this struct was generated from the following file: