35 #ifndef __SYS_CLASS_H__
36 #define __SYS_CLASS_H__
46 template<
class Type >
53 #define EVENT( event, function ) { &( event ), ( void ( idClass::* )( void ) )( &function ) },
54 #define END_CLASS { NULL, NULL } };
92 #define CLASS_PROTOTYPE( nameofclass ) \
94 static idTypeInfo Type; \
95 static idClass *CreateInstance( void ); \
96 virtual idTypeInfo *GetType( void ) const; \
97 static idEventFunc<nameofclass> eventCallbacks[]
110 #define CLASS_DECLARATION( nameofsuperclass, nameofclass ) \
111 idTypeInfo nameofclass::Type( #nameofclass, #nameofsuperclass, \
112 ( idEventFunc<idClass> * )nameofclass::eventCallbacks, nameofclass::CreateInstance, ( void ( idClass::* )( void ) )&nameofclass::Spawn, \
113 ( void ( idClass::* )( idSaveGame * ) const )&nameofclass::Save, ( void ( idClass::* )( idRestoreGame * ) )&nameofclass::Restore ); \
114 idClass *nameofclass::CreateInstance( void ) { \
116 nameofclass *ptr = new nameofclass; \
117 ptr->FindUninitializedMemory(); \
120 catch( idAllocError & ) { \
124 idTypeInfo *nameofclass::GetType( void ) const { \
125 return &( nameofclass::Type ); \
127 idEventFunc<nameofclass> nameofclass::eventCallbacks[] = {
138 #define ABSTRACT_PROTOTYPE( nameofclass ) \
140 static idTypeInfo Type; \
141 static idClass *CreateInstance( void ); \
142 virtual idTypeInfo *GetType( void ) const; \
143 static idEventFunc<nameofclass> eventCallbacks[]
156 #define ABSTRACT_DECLARATION( nameofsuperclass, nameofclass ) \
157 idTypeInfo nameofclass::Type( #nameofclass, #nameofsuperclass, \
158 ( idEventFunc<idClass> * )nameofclass::eventCallbacks, nameofclass::CreateInstance, ( void ( idClass::* )( void ) )&nameofclass::Spawn, \
159 ( void ( idClass::* )( idSaveGame * ) const )&nameofclass::Save, ( void ( idClass::* )( idRestoreGame * ) )&nameofclass::Restore ); \
160 idClass *nameofclass::CreateInstance( void ) { \
161 gameLocal.Error( "Cannot instanciate abstract class %s.", #nameofclass ); \
164 idTypeInfo *nameofclass::GetType( void ) const { \
165 return &( nameofclass::Type ); \
167 idEventFunc<nameofclass> nameofclass::eventCallbacks[] = {
178 #ifdef ID_REDIRECT_NEWDELETE
181 void *
operator new( size_t );
182 void *
operator new(
size_t s,
int,
int,
char *,
int );
183 void operator delete(
void * );
184 void operator delete(
void *,
int,
int,
char *,
int );
185 #ifdef ID_REDIRECT_NEWDELETE
186 #define new ID_DEBUG_NEW
239 static void Init(
void );
341 return subclass->
IsType( superclass );
idHierarchy< idTypeInfo > node
static void DisplayInfo_f(const idCmdArgs &args)
idEventFunc< idClass > * eventCallbacks
idEventArg(const struct trace_s *data)
GLsizei const GLfloat * value
bool PostEventSec(const idEventDef *ev, float time)
assert(prefInfo.fullscreenBtn)
static idTypeInfo * GetType(int num)
idEventArg(const idStr &data)
static void ListClasses_f(const idCmdArgs &args)
void FindUninitializedMemory(void)
void(idClass::* classSpawnFunc_t)(void)
bool IsType(const idTypeInfo &c) const
idEventArg(const class idEntity *data)
ABSTRACT_PROTOTYPE(idClass)
static idClass * CreateInstance(const char *name)
bool ProcessEvent(const idEventDef *ev)
static idList< idTypeInfo * > typenums
static int GetTypeNumBits(void)
bool RespondsTo(const idEventDef &ev) const
bool RespondsTo(const idEventDef &ev) const
const idEventDef EV_SafeRemove
void Save(idSaveGame *savefile) const
idAllocError(const char *text="")
static int GetNumTypes(void)
GLuint GLuint GLsizei GLenum type
const char * GetClassname(void) const
idTypeInfo(const char *classname, const char *superclass, idEventFunc< idClass > *eventCallbacks, idClass *(*CreateInstance)(void), void(idClass::*Spawn)(void), void(idClass::*Save)(idSaveGame *savefile) const, void(idClass::*Restore)(idRestoreGame *savefile))
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
void(idClass::* Restore)(idRestoreGame *savefile)
classSpawnFunc_t CallSpawnFunc(idTypeInfo *cls)
GLuint GLuint GLuint GLuint arg1
void(idClass::* Save)(idSaveGame *savefile) const
const char * GetSuperclass(void) const
eventCallback_t * eventMap
bool ProcessEventArgs(const idEventDef *ev, int numargs,...)
void(idClass::* Spawn)(void)
bool IsType(const idTypeInfo &superclass) const
static idList< idTypeInfo * > types
GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg3
static void Shutdown(void)
GLsizei GLsizei GLenum GLenum const GLvoid * data
void Restore(idRestoreGame *savefile)
static idTypeInfo * GetClass(const char *name)
void CancelEvents(const idEventDef *ev)
void Event_SafeRemove(void)
int GetEventNum(void) const
void(idClass::* eventCallback_t)(void)
idEventArg(const char *data)
bool PostEventArgs(const idEventDef *ev, int time, int numargs,...)
bool ProcessEventArgPtr(const idEventDef *ev, int *data)
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
const char * c_str(void) const
bool PostEventMS(const idEventDef *ev, int time)
const idEventDef EV_Remove
idClass *(* CreateInstance)(void)