register_class


Description:

public unowned Class register_class (string name, Class? parent_class, ClassVTable? vtable, DestroyNotify? destroy_notify)

Register a custom class in this using the given name.

If the new class inherits from another Class, the parent should be passed as parent_class, otherwise null should be used. The optional vtable parameter allows to provide a custom implementation for handling the class, for example, to handle external properties not added to the prototype. When an instance of the Class is cleared in the context, destroy_notify is called with the instance as parameter.

Parameters:

this

a Context

name

the class name

parent_class

a Class or null

vtable

an optional ClassVTable or null

destroy_notify

a destroy notifier for class instances

Returns:

a Class