MetaClass: 2.3 Utility Messages: Object Management Messages

Up: GEOS SDK TechDocs | Up | Prev: 2.2 Class Messages | Next: 2.4 User Interface Utility Meta Messages

These messages fill in and resolve an object's instance data. They should usually not be subclassed, and will be sent by applications infrequently (if ever).

MSG_META_RESOLVE_VARIANT_SUPERCLASS

ClassStruct * MSG_META_RESOLVE_VARIANT_SUPERCLASS(
        word	MasterOffset);

This message is sent by the object system when it needs to know the run-time superclass of a particular object's variant master class. The system sends this message to the object when it first attempts to deliver a message to the superclass of a variant class. The object must examine itself and determine what its superclass for that master level should be.

Source: Object system.

Destination: Any object with a variant class in its class hierarchy.

Interception: Because variant master classes tend to be strictly administrative in nature, providing useful and very generic functionality to their subclasses, all immediate children of a variant master class will need to intercept this message and return the appropriate class pointer.

Parameters: MasterOffset Master offset of the level being resolved. If you know there's a variant class above your own, you will need to examine this to determine if it is your master level whose variant is being resolved, or the one above you.

Return: Superclass to use.

MSG_META_RELOCATE

Boolean 	MSG_META_RELOCATE(
        word		vMRelocType,
        word		frame);

This message is sent by the object system to evaluate and resolve all of the object's relocatable instance data fields (pointers, optrs, etc.). Note that this only applies if the class' CLASSF_HAS_RELOC flag is set.

NOTE: The calling of this method is non-standard in that it does not pass through the class's method table. Rather, the handler address is placed after the method table and a direct call is issued. This means a relocation routine should not be bound to MSG_META_RELOCATE but should rather be bound to @reloc , which Goc understands to mean the handler is for both MSG_META_RELOCATE and MSG_META_UNRELOCATE .

Note also that relocation-by-routine happens in addition to (but before) any relocation due to the class' relocation table. To suppress relocation-by-table, you should initialize the class record with the CLASSF_HAS_RELOC flag to prevent Goc from generating a table for the class.

Source: Kernel, when loading in object block, general resources, or object blocks stored in VM file format.

Destination: Individual object needing relocations beyond what the kernel can do automatically (or that simply request for this message to be sent by having their CLASSF_HAS_RELOC bit set)

Interception: Intercepted by any class needing to perform special relocations on its instance data. Superclass should be called, in case a superclass also needs to perform this operation on its own instance data.

Parameters: vmRelocType Type giving some context to the relocation.

frame
Frame to pass to ObjRelocOrUnRelocSuper() .

Return: If an error occurred, this will return true .

Structures:

  typedef enum {
	VMRT_UNRELOCATE_BEFORE_WRITE,
	VMRT_RELOCATE_AFTER_READ,
	VMRT_RELOCATE_AFTER_WRITE,
	VMRT_RELOCATE_FROM_RESOURCE,
	VMRT_UNRELOCATE_FROM_RESOURCE
} VMRelocType;

Warnings: This method may not call LMemAlloc() , LMemReAlloc() , or LMemFree() .

MSG_META_UNRELOCATE

Boolean 	MSG_META_UNRELOCATE(
        word		vMRelocType,
        word		frame);

This message causes an object to unresolve all its relocatable instance data fields, returning them to special index values.

Source: Kernel, when loading in object block, general resources, or object blocks stored in VM file format.

Destination: Individual object needing relocations beyond what the kernel can do automatically (or that simply request for this message to be sent by having their CLASSF_HAS_RELOC bit set).

Interception: Intercepted by any class needing to perform special relocations on its instance data. Superclass should be called, in case a superclass also needs to perform this operation on its own instance data.

Parameters: vmRelocType Type giving some context to the relocation.

frame
Frame to pass to ObjRelocOrUnRelocSuper() .

Return: If an error occurred, this will return true .

Structures:

typedef enum {
	VMRT_UNRELOCATE_BEFORE_WRITE,
	VMRT_RELOCATE_AFTER_READ,
	VMRT_RELOCATE_AFTER_WRITE,
	VMRT_RELOCATE_FROM_RESOURCE,
	VMRT_UNRELOCATE_FROM_RESOURCE
} VMRelocType;

Warnings: This method may not call LMemAlloc() , LMemReAlloc() , or LMemFree() .


Up: GEOS SDK TechDocs | Up | Prev: 2.2 Class Messages | Next: 2.4 User Interface Utility Meta Messages