struct __CFClass {
const char *name;
size_t size;
bool (*ctor)(void*, va_list);
void (*dtor)(void*);
bool (*equal)(void*, void*);
uint32_t (*hash)(void*);
void* (*copy)(void*);
CFStringRef (*toString)(void*);
} ;
struct __CFObject {
CFClassRef cls;
int ref_cnt;
} ;
struct __Shape {
struct __CFObject obj;
struct ShapeVtbl const *vptr; /* <== Shape's Virtual Pointer */
int16_t x; /* x-coordinate of Shape's position */
int16_t y; /* y-coordinate of Shape's position */
};
struct __Rectangle {
struct __CFObject obj;
ShapeRef super; /* <== inherits Shape */
/* attributes added by this subclass... */
uint16_t width;
uint16_t height;
};
|