Skip to content

MDL Extension | Objects

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

This MDL extension provides the capability for describing classes, and hence the objects they in turn describe. This extension is meant to provide the widest range of features, including:

  • Public fast Member Variables.
  • Private Member Variable Space.
  • Methods.
  • Class methods.
  • Static class methods.
  • Constructors.
  • Destructors.
  • Inheritance.
  • Multiple Inheritance (with separated, or shared, base class).
  • Interfaces. (abstract classes)

It is up to plugin language extension writers to work with (or provide) these features in the language they implement. Like all extensions, an expansion function is provided to expand the extension into base MDL.

Implementation

An object, an instance of a class, is a pointer to a struct, while in reality the pointed at struct contains the majority of information for the object, the pointer represents the conceptual object.

The object struct contains the following fields:

  • Class (Pointer) - This is a pointer to the class struct providing methods for the object.
  • Private (Void Pointer) - This is where the plugin language wrapper that created the object can store a pointer to the actual representation of the object.
  • Parent Objects (Array[#parents] Pointers) - This is a pointer to the objects representing this objects parents (since the may be provided by other plugins).
  • Public struct data (Varies) - Public fast access data.

The class struct contains the following fields:

  • Parents (Array[#parents] Pointers) - This is a pointer to the classes representing this classes parents. (for super calling).
  • Methods (Various Function Pointers) - Pointers to all of the class methods. Arranged by static, class, object, and then by name alphabetically.

Clone this wiki locally