In addition, an operation is provided for retrieving the object at which a cursor is positioned, together with an os_type representing the type of the object, and, for an object that is an array, a number indicating how many elements it has.
os_boolean current( void* &pointer, const os_type* &type, os_int32 &count ) const;If the cursor is positioned at an object, returns nonzero (true), sets pointer to refer to the address of the object, and sets type to refer to an os_type representing the object's type. If the object is an array, count is set to refer to the number of elements it has; if the object is not an array, count is set to 0. If the cursor is not positioned at an object, 0 (false) is returned, and all three arguments are set to refer to 0.
void first();Positions the cursor at the first object in the cursor's associated segment. The object is first in an arbitrary order that is stable across traversals of the segment, as long as no objects are created or deleted from the segment, and no reorganization is performed (using schema evolution or compaction). If there are no objects in the cursor's associated segment, the cursor is positioned at no object.
os_boolean more() const;Returns nonzero (true) if the cursor is positioned at an object. Returns 0 (false) otherwise.
void next();Positions the cursor at the next object in the cursor's associated segment. The object is next in an arbitrary order that is stable across traversals of the segment, as long as no objects are created or deleted from the segment, and no reorganization is performed (using schema evolution or compaction). If the cursor is positioned at no object, err_cursor_at_end is signaled. Otherwise, if there is no next object, the cursor is positioned at no object.
os_object_cursor(os_segment *seg);Creates a new os_object_cursor associated with the specified segment. If the segment is empty, the cursor is positioned at no object; otherwise it is positioned at the first object in the cursor's associated segment. The object is first in an arbitrary order that is stable across traversals of the segment, as long as no objects are created or deleted from the segment, and no reorganization is performed (using schema evolution or compaction).
void set(const void *ptr);Positions the cursor at the object containing the address ptr. If ptr is not an address in the specified cursor's associated segment, signals err_cursor_not_at_object. If ptr is in the cursor's associated segment but within unallocated space, the cursor is positioned at no object or is arbitrarily positioned at an object in the segment.
~os_object_cursor();Performs internal maintenance associated with os_object_cursor deallocation.
Updated: 03/31/98 17:25:09