Up: GEOS SDK TechDocs | Up | Prev: ObjInitDetach() ... | Next: ObjResizeMaster() ...

ObjIsClassADescendant()

Boolean	ObjIsClassADescendant(
        ClassStruct		* class1,				/* proposed ancestor */
        ClassStruct		* class2);				/* proposed descendant */

This routine checks if class2 is a descendand of class1 and returns true if it is.

Include: object.h

ObjIsObjectInClass()

Boolean	ObjIsObjectInClass(
        optr		obj,				/* object to check */
        ClassStruct		* class);				/* proposed class */

This routine checks to see if the passed object is a member of the specified class. It checks superclasses as well, but if an unresolved variant class is encountered, the variant will not be resolved. If you want to search past variant class links, you should sent MSG_META_DUMMY to the object first. The two parameters for this routine are

obj
The optr of the object to be checked. Its object block must be locked down before this routine is called. (If the object's block might not be locked down, perhaps you should send MSG_META_IS_OBJECT_IN_CLASS to the object instead of calling this routine.
class
A pointer to the subject class' ClassStruct definition.

ObjIsObjectInClass() returns true if the object is in the class, false (zero) if it is not.

Include: object.h

ObjIsObjectInClassHandles()

Boolean	ObjIsObjectInClassHandles(
        MemHandle		mh,				/* handle portion of optr */
        ChunkHandle		ch,				/* chunk portion of optr */
        ClassStruct		* class);				/* proposed class */

This routine is just like ObjIsObjectInClass() except the object is specified via its handles rather than its optr.

Include: object.h

ObjLinkFindParent()

optr	ObjLinkFindParent(
        optr	obj,		/* child's optr */
        word	masterOffset,		/* offset to master part with link field */
        word	linkOffset);		/* offset in master part to link field */

This routine returns the optr of the specified object's parent. It must be passed the following:

obj
The optr of the object whose parent is to be found.
masterOffset
The offset within the object's instance chunk to its master group's offset (the value that would appear in the Class_masterOffset field in its ClassStruct structure).
linkOffset
The offset within the object's instance chunk to the link field.

Include: metaC.goh

See Also: MSG_VIS_FIND_PARENT, MSG_GEN_FIND_PARENT.

ObjLockObjBlock()

void	* ObjLockObjBlock(
        MemHandle mh);			/* handle of object block */

This routine locks an object block, loading in the block if necessary. It must be passed the handle of the block, and it returns the locked block's segment address. When the caller is done using the block, it should unlock it with MemUnlock() .

Be Sure To: Always unlock the block when you are done with it, with MemUnlock() .

Include: object.h

See Also: MemLock(), MemUnlock().

ObjMapSavedToState()

VMBlockHandle ObjMapSavedToState(
        MemHandle mh);			/* handle of object block */

This routine returns the VM block handle of the state file block corresponding to the passed object block. If the specified object block has no state file equivalent, a null handle is returned.

Include: object.h

ObjMapStateToSaved()

MemHandle ObjMapStateToSaved(
        VMBlockHandle		vmbh,			/* VM block handle of state block */
        GeodeHandle		gh);			/* handle of geode owning block */

This routine takes a VM block handle and a geode handle and returns the memory block corresponding to the VM block, if any. The two parameters are

vmbh
The VM block handle of the VM block to be mapped.
gh
The geode handle of the owner of the block, or zero to use the calling geode's handle.

If the block is found, ObjMapStateToSaved() returns its handle. If the block is not found, it returns a null handle.

Include: object.h

ObjMarkDirty()

void	ObjMarkDirty(
        optr 	o);	/* object to be marked dirty */

This routine marks an object dirty, indicating that changes to it should be saved when its object block is saved. If you want changes to objects saved, you should mark the object dirty.

Tips and Tricks: Often you do not need this routine because parameters or flags to other routines will set the object dirty automatically. If there is any doubt, however, you should use this routine.

Include: object.h

See Also: ObjChunkFlags, ObjSetFlags().

ObjMarkDirtyHandles()

void	ObjMarkDirtyHandles(
        MemHandle		mh,			/* handle portion of optr */
        ChunkHandle		ch);			/* chunk portion of optr */

This routine is the same as ObjMarkDirty() except that it specifies the object via handles rather than an optr.

ObjProcBroadcastMessage()

void	ObjProcBroadcastMessage(
        EventHandle event);			/* the event to be broadcast */

This routine broadcasts the given event to all threads which have message queues. It must be passed an encapsulated event (usually recorded with @record ) and returns nothing. This is typically used for notification purposes.

Include: metaC.goh

ObjRelocateEntryPoint()

void *	ObjRelocateEntryPoint(
        EntryPointRelocation *			relocData);

ObjRelocOrUnRelocSuper()

void	ObjRelocOrUnRelocSuper(
        optr 		oself,
        ClassStruct		*class,
        word		frame);

Call this routine to relocate an object's superclass.

Include: object.h


Up: GEOS SDK TechDocs | Up | Prev: ObjInitDetach() ... | Next: ObjResizeMaster() ...