Class: TViewRequestComputation

Declaration: ViewRequest.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TRequestComputation

Inherited By:

None.

Purpose:

TViewRequestComputations are similar to TViewRequest instances, except that they are invoked in synchronous contexts. Synchronous contexts are where the request invoker blocks until execution finishes. As a result, the two threads involved are synchronized for the duration of the execution of the operation. You can use this class to allow for operations which need to return values to their calling thread in a thread-safe manner.

Instantiation:

Always allocate on the heap. It will be adopted by the request handler.

Deriving Classes:

Same as for TRequestComputation.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TViewRequestComputation::TViewRequestComputation

  1. TViewRequestComputation (TViewHandle * toAdopt)
  2. TViewRequestComputation ()
  3. TViewRequestComputation (const TViewRequestComputation &)

Interface Category:

API.

Purpose:

  1. Creates a new request instance with the specified parameter as the target of the request.
  2. Default constructor.
  3. Copy constructor.

Calling Context:

  1. Called when the target view already exists.
  2. Called to create a non-targeted instance, so that the target may be set later.
  3. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TViewRequestComputation::~TViewRequestComputation

virtual ~ TViewRequestComputation ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TViewRequestComputation::operator=

TViewRequestComputation & operator =(const TViewRequestComputation &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TViewRequestComputation::SetTarget

virtual void SetTarget (TViewHandle * toAdopt)

Interface Category:

API.

Purpose:

Sets the target view handle for the request.

Calling Context:

The view handle will be adopted by the request object. This function can be called from any thread. However, only one thread at a time should be holding on to the request.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TViewRequestComputation::GetView

TView * GetView () const

Interface Category:

API.

Purpose:

Returns the view that this request is targeted for. This function returns NIL if the view has been deleted since the request was queued.

Calling Context:

Call only from the thread that owns the view. The request should be executing from the thread that owns the view.

Parameters:

Return Value:

The view that is the target of the request, or NIL if the target has not been set yet, or if the view has been deleted.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.