WebSphere Message Service Client for C/C++, Version 2.0.2 Operating Systems: AIX, Linux, Solaris, Windows

Iterator

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.

Functions

Summary of functions:
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.

xmsIteratorDispose – Delete Iterator

Interface:
xmsRC xmsIteratorDispose(xmsHIterator *iterator,
                         xmsHErrorBlock errorBlock);

Delete the iterator.

If an application tries to delete an iterator that is already deleted, the call is ignored.

Parameters:
iterator (input/output)
On input, the handle for the iterator. On output, the function returns a null handle.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

xmsIteratorGetNext – Get Next Object

Interface:
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.

Parameters:
iterator (input)
The handle for the iterator.
object (output)
The handle for the object.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

xmsIteratorHasNext – Check for More Objects

Interface:
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.

Parameters:
iterator (input)
The handle for the iterator.
moreProperties (output)
The value is xmsTRUE if there are more objects beyond the current position of the cursor. The value is xmsFALSE if there are no more objects beyond the current position of the cursor.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

xmsIteratorReset – Reset Iterator

Interface:
xmsRC xmsIteratorReset(xmsHIterator iterator,
                       xmsHErrorBlock errorBlock);

Move the cursor back to a position before the first object.

Parameters:
iterator (input)
The handle for the iterator.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

Reference topic

Terms of Use | Rate this page

Last updated: 24 May 2011

(C) Copyright IBM Corporation 2005, 2011. All Rights Reserved.