QuakeForge  0.7.2.210-815cf
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
object.h File Reference
This graph shows which files directly or indirectly include this file:

Data Structures

struct  Object_s
 
struct  ObjRefs_s
 

Macros

#define CLASS(o)   ((Class *)(o))
 
#define classDecl(name, extends, def)   typedef struct name##_s {struct extends##_s base; def} name; extern Class * classObj(name); void __class_##name##_init (void)
 
#define classInit(name)   __class_##name##_init()
 
#define classInitFunc(name)   Class * classObj(name); void __class_##name##_init (void)
 
#define classObj(name)   name##_class
 
#define instanceOf(obj, cl)   (Object_InstaceOf((Object *)obj, cl##_class))
 
#define methodCall(obj, m,...)   ((obj)->m(obj, ##__VA_ARGS__))
 
#define methodDecl(type, name,...)   (* name) (struct type##_s *self, ##__VA_ARGS__)
 
#define new(cl,...)   ((void *) (cl##_class->init (Object_Create(cl##_class, false) , ##__VA_ARGS__)))
 
#define newPerm(cl,...)   ((void *) (cl##_class->init (Object_Create(cl##_class, true) , ##__VA_ARGS__)))
 
#define OBJECT(o)   ((Object *)(o))
 
#define release(obj)   (Object_Release((Object *)obj))
 
#define retain(obj)   (Object_Retain((Object *)obj))
 
#define superInit(cl, obj,...)   (cl##_class->parent->init ((obj), ##__VA_ARGS__))
 

Typedefs

typedef struct Object_s Object
 
typedef void(* Object_Deinit_t )(Object *obj)
 
typedef Object *(* Object_Init_t )(Object *obj,...)
 
typedef struct ObjRefs_s ObjRefs_t
 
typedef void(* ReplyHandler_t )(struct Object_s *retValue)
 

Functions

 classDecl (Class, Object, unsigned abstract:1;unsigned alwaysperm:1;unsigned int size;const char *name;struct Class_s *parent;Object_Init_t init;Object_Deinit_t deinit;)
 
void Object_AddToRoot (Object *obj)
 
ObjectObject_Create (Class *cl, qboolean perm)
 
void Object_Delete (Object *obj)
 
void Object_Garbage_Collect (void)
 
void Object_Init (void)
 
qboolean Object_InstanceOf (Object *obj, Class *cl)
 
ObjectObject_Release (Object *obj)
 
void Object_RemoveFromRoot (Object *obj)
 
ObjectObject_Retain (Object *obj)
 

Variables

struct Class_s * Object_class
 

Macro Definition Documentation

#define CLASS (   o)    ((Class *)(o))
#define classDecl (   name,
  extends,
  def 
)    typedef struct name##_s {struct extends##_s base; def} name; extern Class * classObj(name); void __class_##name##_init (void)
#define classInit (   name)    __class_##name##_init()
#define classInitFunc (   name)    Class * classObj(name); void __class_##name##_init (void)
#define classObj (   name)    name##_class
#define instanceOf (   obj,
  cl 
)    (Object_InstaceOf((Object *)obj, cl##_class))
#define methodCall (   obj,
  m,
  ... 
)    ((obj)->m(obj, ##__VA_ARGS__))
#define methodDecl (   type,
  name,
  ... 
)    (* name) (struct type##_s *self, ##__VA_ARGS__)
#define new (   cl,
  ... 
)    ((void *) (cl##_class->init (Object_Create(cl##_class, false) , ##__VA_ARGS__)))
#define newPerm (   cl,
  ... 
)    ((void *) (cl##_class->init (Object_Create(cl##_class, true) , ##__VA_ARGS__)))
#define OBJECT (   o)    ((Object *)(o))
#define release (   obj)    (Object_Release((Object *)obj))
#define retain (   obj)    (Object_Retain((Object *)obj))
#define superInit (   cl,
  obj,
  ... 
)    (cl##_class->parent->init ((obj), ##__VA_ARGS__))

Typedef Documentation

typedef struct Object_s Object
typedef void(* Object_Deinit_t)(Object *obj)
typedef Object*(* Object_Init_t)(Object *obj,...)
typedef struct ObjRefs_s ObjRefs_t
typedef void(* ReplyHandler_t)(struct Object_s *retValue)

Function Documentation

classDecl ( Class  ,
Object  ,
unsigned abstract:1;unsigned alwaysperm:1;unsigned int size;const char *name;struct Class_s *parent;Object_Init_t init;Object_Deinit_t deinit;   
)
void Object_AddToRoot ( Object obj)
Object* Object_Create ( Class *  cl,
qboolean  perm 
)
void Object_Delete ( Object obj)
void Object_Garbage_Collect ( void  )
void Object_Init ( void  )
qboolean Object_InstanceOf ( Object obj,
Class *  cl 
)
Object* Object_Release ( Object obj)
void Object_RemoveFromRoot ( Object obj)
Object* Object_Retain ( Object obj)

Variable Documentation

struct Class_s* Object_class