INonGUIThread::Cursor

The INonGUIThread::Cursor class creates and manages the cursor for an INonGUIThread object. This nested class defines objects that you can use to traverse or iterate through a set of active threads. In the same way that you can use a cursor to traverse the objects in a collection, you can use this cursor to traverse a set of threads one at a time.

Typically, you traverse a set, or collection, of active threads by doing the following:

  1. Calling setToFirst
  2. Looping through the threads using setToNext
  3. Processing the returned thread IDs from threadId until isValid returns false

Note: This class only provides access to threads that are or have been represented by an INonGUIThread object or an object of a derived class, such as IThread.


INonGUIThread::Cursor - Member Functions and Data by Group

Constructors & Destructor

Use these members to construct and destruct objects of this nested class.


[view class]
~Cursor
public:
virtual ~Cursor()
Destroys the cursor object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
Cursor
public:
Cursor(bool allThreads = true)
Constructs objects of this class.

allThread
This is ignored and is present only for backwards compatibility.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Thread Iteration

Use these members to iterate through the set of active threads.


[view class]
invalidate
public:
virtual void invalidate()
Marks the cursor as invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
isValid
public:
virtual bool isValid() const
Determines if the cursor is valid. If it is valid, true is returned.

Return
true if the cursor is valid, else false.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setToFirst
public:
virtual bool setToFirst()
Sets the cursor's position to the first thread.

Return
true if this validated the cursor, else false.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setToNext
public:
virtual bool setToNext()
Advances the cursor's position to the next thread.

Return
true if cursor is still valid, else false.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
threadId
public:
IThreadId threadId() const
Obtains the identifier (ID) of the thread at the current cursor position.

Return
The id for the currently cursored thread.

Exception

IInvalidParameter The thread identifier (ID) was not returned. The cursor is not valid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


INonGUIThread::Cursor - Inherited Member Functions and Data

Inherited Public Functions

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data