Class: TRequestHandler

Declaration: RequestProcessor.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

TRequestHandler is used to dispatch requests in a TRequestQueue. A referenced request queue is provided in the constructor. The client provides the thread that does the work of handling requests by calling one of the dispatch member functions. The dispatch member function with the simplest behavior (which is therefore recommended) is WaitAndDispatchNextRequest, which always handles precisely one request before returning (and therefore waiting for a request if necessary. The dispatch pending request calls return immediately if there are not requests. However, unless the client is externally guaranteeing that the queue is frozen while these calls return, the client can't assume that the queue is empty upon return because more requests can get queued.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Member Function: TRequestHandler::TRequestHandler

TRequestHandler (TRequestQueue * requestQueue)

Interface Category:

API.

Purpose:

Creates a request handler that will handle requests posted to the specified queue.

Calling Context:

You can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TRequestHandler::~TRequestHandler

virtual ~ TRequestHandler ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object. You can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TRequestHandler::WaitAndDispatchNextRequest

virtual void WaitAndDispatchNextRequest ()

Interface Category:

API.

Purpose:

Waits for a request to be available from the queue. When one is available is removes it, executes it (calls Do) and deletes it.

Calling Context:

You can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TRequestHandler::DispatchNextPendingRequest

virtual void DispatchNextPendingRequest ()

Interface Category:

API.

Purpose:

Dispatches the next request if one is available.

Calling Context:

You can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TRequestHandler::DispatchAllPendingRequests

virtual void DispatchAllPendingRequests ()

Interface Category:

API.

Purpose:

Dispatches all pending requests. Returns after all requests on the queue have been removed and executed.

Calling Context:

You can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TRequestHandler::IsQueueEmpty

virtual bool IsQueueEmpty ()

Interface Category:

API.

Purpose:

Checks if the associated request queue is empty.

Calling Context:

You can call this function directly.

Parameters:

Return Value:

Returns true if queue if empty.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TRequestHandler::GetRequestQueue

TRequestQueue * GetRequestQueue ()

Interface Category:

API.

Purpose:

Provides access to the request queue associated with this handler.

Calling Context:

You can call this function directly.

Parameters:

Return Value:

TRequestQueue * -The associated request queue.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

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.