Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Threads Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWRunnableHandle

Module:  Threads   Package:  Threading


RWRunnableHandle RWHandleBase

Local Index

Members

Non-Members

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() const;
RWExecutionState
getExecutionState() const;
bool
isInterruptRequested() const;
bool
isSelf() const;
bool
isSelf(const RWThreadId& id) const;
void
removeCallback(const RWTFunctor2<const RWRunnable&,
               RWExecutionState>& functor);
RWThreadId
threadId() const;

Protected Constructors

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

Protected Destructor

~RWRunnableHandle();

Protected Member Operator

RWRunnableHandle&
operator=(const RWRunnableHandle& second);

See Also

RWRunnable, RWRunnableSelf



Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.