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

ObjFreeChunk()

void	ObjFreeChunk(
        optr	o);		/* optr of chunk to be freed */

This routine frees the passed object's instance chunk. If the object came from a loaded resource, however, the object is resized to zero and marked dirty rather than actually freed.

Warnings: The object must be fully detached, and its message queues must be empty before it can safely be freed. All this is handled by MSG_META_DETACH and MSG_META_OBJ_FREE .

Include: object.h

See Also: MSG_META_DETACH, MSG_META_OBJ_FREE, ObjInstantiate().

ObjFreeChunkHandles()

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

This routine is the same as ObjFreeChunk(); the chunk is specified by its handles rather than by an optr.

Include: object.h

ObjFreeDuplicate()

void	ObjFreeDuplicate(
        MemHandle mh);			/* handle of duplicate block to be freed */

This routine frees a block that had been saved with ObjSaveBlock() or created with ObjDuplicateResource() . It must be passed the memory handle of the duplicated resource.

Warnings: All objects in the duplicated resource must be properly detached to ensure that nothing tries to send messages to the objects in the block. Additionally, the block's in-use count and interactable count should be zero.

Include: object.h

See Also: ObjDuplicateResource(), ObjSaveBlock(), ObjLMemBlockHeader.

ObjFreeMessage()

void	ObjFreeMessage(
        EventHandle event);				/* event to be freed */

This routine frees an event handle and its associated event. This is rarely, if ever, used by anything other than the kernel. The kernel uses this routine to free events after they have been handled.

Include: object.h

ObjFreeObjBlock()

void	ObjFreeObjBlock(
        MemHandle block);			/* handle of the object block to be freed */

This routine frees the specified object block. It first checks the block's in-use count to see if any external references to the block are being kept. If the in-use count is nonzero, ObjFreeObjBlock() simply sets the block's auto-free bit and returns; the block will be freed the first time the in-use count reaches zero. If the in-use count is zero (no external references), the block will be freed immediately.

If the object block passed is not run by the calling thread, the operation will be handled by a remote call in the object block's thread.

Include: object.h

See Also: ObjFreeDuplicate(), MSG_META_BLOCK_FREE.

ObjGetFlags()

ObjChunkFlags ObjGetFlags(
        optr	o);		/* optr of subject object */

This routine returns the object flags associated with a given object. The object is specified by the passed optr, and the flags are stored in the object's ObjChunkFlags record.

Include: object.h

See Also: ObjSetFlags(), ObjChunkFlags.

ObjGetFlagsHandles()

ObjChunkFlags ObjGetFlagsHandles(
        Memhandle		mh,			/* handle portion of optr */
        ChunkHandle		ch);			/* chunk portion of optr */

This routine is the same as ObjGetFlags() , but the object is specified with its handles rather than with its optr.

Include: object.h

ObjGetMessageInfo()

Message	ObjGetMessageInfo(
        EventHandle		event,				/* event to be queried */
        optr	 	* dest);				/* buffer for destination optr */

This routine gets information about the specified event . The return value is the message number of the event. The dest parameter is a pointer to an optr. This routine will return with the optr represinting the event's destination object.

Include: object.h

ObjIncDetach()

void	ObjIncDetach(
        optr	obj);		/* optr of calling object */

This routine increments the number of detach acknowledgments an object must receive before it can safely be detached. Each time the detaching object sends notification of its detachment, it must call ObjIncDetach() to indicate that it must receive a corresponding detach acknowledgment ( MSG_META_ACK ).

The calling object must have previously called ObjInitDetach() . Since the detach mechanism is implemented in MetaClass , it is highly unlikely you will ever need to call this routine. ObjIncDetach() takes a single parameter: the optr of the calling object.

Include: metaC.goh

See Also: MSG_META_DETACH, ObjInitDetach(), ObjEnableDetach(), MSG_META_ACK.

ObjIncInteractibleCount()

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

This routine increments the interactable count of the given object block. The interactable count maintains the number of objects currently visible to the user or about to be acted on by the user (e.g. via keyboard accelerator). The interactable count is maintained by the UI; only in extremely special cases may you need to increment or decrement the count. To decrement the count, use ObjDecInteractibleCount() .

Visible objects increment the interactable count in their MSG_VIS_OPEN handlers and decrement it in their MSG_VIS_CLOSE handlers. This is built into VisClass .

Include: object.h

See Also: ObjDecInteractibleCount(), MSG_VIS_OPEN, MSG_VIS_CLOSE, ObjLMemBlockHeader.

ObjIncInUseCount()

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

This routine increments the given object block's in-use count. The in-use count maintains the number of outside references to this object block which are stored elsewhere and which need to be removed before the block can safely be freed. If you store an optr to an object block, you should increment the in-use count of the block.

When the reference to the block is removed, the in-use count should be decremented with ObjDecInUseCount() .

Include: object.h

See Also: ObjDecInUseCount(), ObjIncInteractibleCount(), ObjLMemBlockHeader.


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