4 Copyright © 1997-98, The AROS Development Team. All rights reserved.
7 Desc: Demo of new OOP system
18 typedef struct IClass Class
;
23 /* Array of pointers to methodtables for this class */
24 struct Node ClassNode
;
29 /* The number of methods in the hashtable */
36 struct Bucket
**HashTable
;
37 ULONG HashTableSize
; /* Hashtable size counted in number of *entries* (not bytes) */
54 /* Used when initializing a class */
66 #define NUM_METHOD_BITS 10
68 #define BASEOBJECT(obj) ((Object *)(_OBJ(obj) + 1))
69 #define _OBJECT(obj) (_OBJ(obj) - 1)
70 #define _OBJ(obj) ((struct _Object *)(obj))
72 #define INST_DATA(cl, obj) \
73 (((VOID *)(obj)) + cl->InstOffset)
76 #define OCLASS(o) (_OBJECT(o)->oClass)
79 #define ROOTCLASS "rootclass"
81 #define RootInterface (0 << NUM_METHOD_BITS)
82 #define M_New (RootInterface + 0)
83 #define M_Dispose (RootInterface + 1)
95 #define CallMethodFast(o, m, msg) \
97 IPTR (*m_func)(Class *, Object *, Msg); \
98 m_func = ((struct Bucket *)m)->MethodFunc; \
99 m_func(((struct Bucket *)m)->Class, o, (Msg)msg); \