[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'Intuition' (#aros)

MakeClass

Create and initialize a boopsi class.

Declaration

Source position: intuition.pas line 3301

function MakeClass(

  ClassID: ClassID;

  SuperClassID: ClassID;

  SuperClassPtr: PIClass;

  InstanceSize: LongWord;

  Flags: LongWord

):PIClass;

Arguments

ClassID

  

Nil for private classes, the name/ID string for public classes

SuperClassID

  

Name/ID of your new class's superclass. Nil if superclass is a private class

SuperClassPtr

  

A pointer to private superclass. Only used if SuperClassID is nil. You are required never to provide a nil superclass.

InstanceSize

  

The size of the instance data that your class's objects will require, beyond that data defined for your superclass's objects.

Flags

  

For future enhancement, including possible additional parameters. Provide zero for now.

Function result

A pointer to the resulting class, or nil if not possible: no memory for class data structure, public superclass not found, public class of same name/ID as this one already exists

Description

For class implementors only.

This function creates a new public or private boopsi class. The superclass should be defined to be another boopsi class: all classes are descendants of the class "rootclass".

Superclasses can be public or private. You provide a name/ID for your class if it is to be a public class (but you must have registered your class name and your attribute ID's with Commodore before you do this!). For a public class, you would also call AddClass() to make it available after you have finished your initialization.

Returns pointer to an TIClass data structure for your class. You then initialize the Hook cl_Dispatcher for your class methods code. You can also set up special data shared by all objects in your class, and point cl_UserData at it. The last step for public classes is to call AddClass().

You dispose of a class created by this function by calling FreeClass().

No copy is made of classID. So make sure the lifetime of the contents of classID is at least the same as the lifetime of the class itself.

See also

FreeClass

  

Frees a boopsi class created by MakeClass().

AddClass

  

Make a public class available

RemoveClass

  

Make a public boopsi class unavailable.

NewObject

  

Varargs version of NewObjectA()


Documentation generated on: 2017-01-10