Skip to content

MDL Extension | Objects

Mason Bially edited this page Jul 4, 2013 · 10 revisions

This MDL extension provides a simple, and extensible, method for creating complex types modeled around object oriented programming.

Base Object Extension

The base object extension describes the base object construct, that is the concept of objects having a specific type which provides information about object instances. It also describes basic object instances.

Nodes

TypeClass(parents, members) a node representing a class using the objects extension. This object provides hookable methods for providing additional object extensions on top of this one.

Implementation

Objects are pointers to object instance structs. An object instance struct contains 3 pointers. The first is a pointer to the class of the object, the classes of objects are themselves objects, and hence is a pointer to an object instance struct. The second pointer in an object instance struct is the private data, this pointer is the unique description of the object, casted objects should still have the same private data pointer. The final pointer is to the public data of the object.

Clone this wiki locally