void ObjInitDetach(
MetaMessages msg,
optr obj /* object being detached */
word callerID, /* an identifier token for the caller */
optr ackOD); /* object to which ack is sent */
Initialize the detach sequence for the specified object. The detach sequence severs all ties between the system and the object, allowing it to be destroyed without other objects or geodes trying to contact it. It is highly unlikely you will ever call this routine; typically, you will instead use
MSG_META_DETACH
or one of the generic or visible object messages, which will call this routine. The parameters for this routine are
obj
callerID
ackOD
Include: metaC.goh
See Also: MSG_META_DETACH,
MSG_GEN_DESTROY,
MSG_VIS_REMOVE,
ObjIncDetach(),
ObjEnableDetach(),
MSG_META_ACK.
void ObjInitializeMaster(
optr obj, /* object to be initialized */
ClassStruct * class); /* class in master group */
This routine initializes the appropriate master part of the passed object, resizing the instance chunk if necessary. It takes two parameters:
obj
class
Warnings: This routine may resize and/or move chunks or object blocks, thereby invalidating pointers and segment addresses.
Include: object.h
See Also: ObjResizeMaster(),
ObjInitializePart(),
ClassStruct.
void ObjInitializeMasterHandles(
MemHandle mh, /* handle portion of optr */
ChunkHandle ch, /* chunk portion of optr */
ClassStruct * class); /* class in master group */
This routine is the same as
ObjInitializeMaster()
except it specifies the object via its handles rather than its optr.
Include: object.h
void ObjInitializePart(
optr obj, /* object to have a part initialized */
word masterOffset); /* offset to master offset in chunk */
This routine initializes all master parts of the given object down to and including the master part specified in
masterOffset
. It will resize the chunk if necessary and even resolve variant classes above the master group specified, if necessary. This routine takes two parameters:
obj
masterOffset
Class_masterOffset
field in its
ClassStruct
structure).Warnings: This routine may move and/or resize chunks or object blocks, thereby invalidating pointers and segment addresses.
Include: object.h
See Also: ObjResizeMaster(),
ObjInitializeMaster(),
MSG_META_RESOLVE_VARIANT_SUPERCLASS.
void ObjInitializePartHandles(
Memhandle mh, /* handle portion of optr */
ChunkHandle ch, /* chunk portion of optr */
word masterOffset); /* master group offset */
This routine is the same as
ObjInitializePart()
except that it specifies the object via its handles rather than an optr.
Include: object.h
optr ObjInstantiate(
MemHandle block, /* block in which new object
* will be instantiated */
ClassStruct * class); /* class of new object */
This routine instantiates a new object, allocating the proper size instance chunk. It returns the optr of the new object; this optr can then be used to send setup messages or other messages (such as adding the object to an object tree, setting it usable, etc.).
The new object's instance data will be initialized to all zeroes if it has no master parts (is a direct descendant of
MetaClass
). If it is a member of some master group, only enough space for the base structure (the master offsets and the class pointer) will be allocated. In either case, initialization of the instance data will occur at a later time.
ObjInstantiate()
takes two parameters:
block
class
ClassStruct
structure of the class of the new object. This pointer will be set in the object's class pointer (the first four bytes of the instance chunk).Warnings: This routine, because it allocates a new chunk, may cause LMem and Object blocks to move or resize, thereby invalidating any pointers and segment addresses. Be sure to dereference pointers after calls to this routine.
Include: object.h
See Also: ObjInstantiateForThread().
optr ObjInstantiateForThread(
ThreadHandle thread, /* thread to run new object */
ClassStruct *class); /* class of new object */
This routine is similar to
ObjInstantiate()
except you pass the thread to run the new object rather than the memory handle to an object block (to store the new object). To specify the current thread, pass "0" in thread. This routine automatically allocates memory blocks as needed. It returns the optr to the new object.
Include: object.h
See Also: ObjInstantiate().
GEOS SDK TechDocs
|
|
ObjFreeChunk() ...
|
ObjIsClassADescendant() ...