An iterator encapsulates a list of objects. An application uses an iterator to access each object in turn.
An iterator also encapsulates a cursor that maintains the current position in the list. When an iterator is created, the position of the cursor is before the first object.
An application cannot create an iterator directly. An iterator is created only by certain functions in order to pass a list of objects back to the application.
This class is a helper class.
Function | Description |
---|---|
xmsIteratorDispose | Delete the iterator. |
xmsIteratorGetNext | Move the cursor to the next object and get the object at the new position of the cursor. |
xmsIteratorHasNext | Check whether there are any more objects beyond the current position of the cursor. |
xmsIteratorReset | Move the cursor back to a position before the first object. |
xmsRC xmsIteratorDispose(xmsHIterator *iterator, xmsHErrorBlock errorBlock);
If an application tries to delete an iterator that is already deleted, the call is ignored.
xmsRC xmsIteratorGetNext(xmsHIterator iterator, xmsHObj *object, xmsHErrorBlock errorBlock);
Move the cursor to the next object and get the object at the new position of the cursor.
xmsRC xmsIteratorHasNext(xmsHIterator iterator, xmsBOOL *moreProperties, xmsHErrorBlock errorBlock);
Check whether there are any more objects beyond the current position of the cursor. The call does not move the cursor.
xmsRC xmsIteratorReset(xmsHIterator iterator, xmsHErrorBlock errorBlock);
Move the cursor back to a position before the first object.