Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWRunnableHandle


RWRunnableHandle RWHandleBase

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Data Types

Member Functions

Package

Threading

Header File

#include <rw/thread/RWRunnableHandle.h>

Description

The RWRunnableHandle class is the base-class for all runnable object handles.

A runnable object provides the basic mechanisms used to create, control, and monitor the threads of execution within your application. Runnables are used to define the task or activity to be performed by a thread.

Each runnable object is reference-counted; a runnable body instance keeps a count of the number of handles that currently reference it. A runnable object is deleted when the last handle that references the body is deleted.

The public interface for a runnable is provided by its handle classes. Many of the public functions in a handle simply forward control to a corresponding protected function in the body class. A runnable handle class instance may be empty. Any attempt to use an empty handle to access a runnable will produce an RWTHRInvalidPointer exception

The RWRunnableHandle class defines those functions that may be accessed from either inside or outside of a runnable. The RWRunnable class provides an interface for threads executing outside of a runnable. It defines the runnable member functions that may only be executed by an external thread. The thread executing inside of a runnable should access the runnable using the RWRunnableSelf handle class.

Global Enumerations

enum RWExecutionState 
enum RWCompletionState {

Public Member Functions

void
addCallback(const RWTFunctor2<const RWRunnable&, 
      RWExecutionState>& functor, unsigned long stateMask, 
      RWCallbackScope scope=RW_CALL_REPEATEDLY);
RWCompletionState
getCompletionState(void) const;
RWExecutionState
getExecutionState(void) const;
RWBoolean
isInterruptRequested(void) const;
RWBoolean
isSelf(void) const;
RWBoolean
isSelf(const RWThreadId& id) const;
void
removeCallback(const RWTFunctor2<const RWRunnable&,
               RWExecutionState>& functor);
RWThreadId
threadId(void) const;

Protected Constructors

RWRunnableHandle(void);
RWRunnableHandle(RWStaticCtor);
RWRunnableHandle(RWRunnableImp* runnableImpP);
RWRunnableHandle(const RWRunnableHandle& second);

Protected Member Operator

RWRunnableHandle&
operator=(const RWRunnableHandle& second);

See Also

RWRunnable, RWRunnableSelf



Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.