8.32. File tom/Extension

class tom.Extension

The Extension class represents the runtime structures for class extensions. All classes have at least one extension, the main extension, which defines the behaviors and the state for that class. All other extensions are defined by the programmer as extensions to the class.

inherits

State supers: State, Conditions

variables

static MutableArray extensions;

All extensions, here to be protected against gc.

methods


instance (id)
  new pointer p;

Designated allocator. Do not use alloc or plain new.

instance tom.Extension

variables

pointer rti;

The runtime structure describing this extension.

Indexed method_selectors;

The selectors for this extension's methods.

Indexed var_names;

The names of this extension's variables.

methods


void
  dealloc;

An Extension should never be deallocated. This method raises, which is a panic during garbage collection...


boolean
  implements selector sel;

Return YES if this extension provides an implementation for the selector sel.


protected id (self)
  init pointer r;

Designated initializer.


class (State)
  meta;

Return the class object to which this extension belongs.


String
  name;

Return the name of this extension. This will be nil for the main extension of a class.


Indexed
  methods;

Return the selectors for the methods in this extension.


boolean
  hasState;

Return whether or not this extension defines variable additions.


Indexed
  variables;

Return the names of the variables in this extension.


int
  typeOfVariableNamed String name
                   in All object;

Return the type of the variable named name. The return value will correspond with one of the TYPEDESC_* constants defined on the Constants class.


Any
  valueOfVariableNamed String name
                    in All object;

Undocumented.


void
         setValue dynamic value
  ofVariableNamed ByteString name
               in All object;

Undocumented.


OutputStream
  writeFields OutputStream s;

Undocumented.


dynamic
  perform selector sel
       on All object
     with dynamic arguments;

The equivalent of perform with where the method invoked is defined by this extension instead of the receiving object. Obviously, the object should actually have this extension as one of its extensions, i.e. [object isKindOf [self meta]] should be a precondition (and a postcondition too, but we're not interested after the fact).


dynamic
  perform selector sel
       on All object
        : Array arguments = nil;

Undocumented.