Skip to content

Latest commit

 

History

History
62 lines (55 loc) · 2.07 KB

notes.md

File metadata and controls

62 lines (55 loc) · 2.07 KB

notes

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;
};

Rectangle

| __CFObject: CFClassRef cls |

| __CFObject: int refcnt |

| ShapeRef: *super | __CFObject: CFClassRef cls

| | __CFObject: int refcnt

|

| VTableRef *vptr |

|

|

|