Class: TStandardProducerConsumerQueue

Declaration: ProducerConsumer.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TProducerConsumerQueue

Inherited By:

None.

Purpose:

This provides a concrete implementation of the TProducerConsumerQueue. It uses a TDeque for the implementation.

Instantiation:

Always allocate on the heap.

Deriving Classes:

None.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Member Function: TStandardProducerConsumerQueue::TStandardProducerConsumerQueue

  1. TStandardProducerConsumerQueue ()
  2. TStandardProducerConsumerQueue (MCollectibleCompareFn testfn)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. The comparison function to use. Generally IsSame or IsEqual.

Calling Context:

  1. Called by the stream-in operators and directly.
  2. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardProducerConsumerQueue::~TStandardProducerConsumerQueue

virtual ~ TStandardProducerConsumerQueue ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardProducerConsumerQueue::HandleAdd

virtual bool HandleAdd (MCollectible *)

Interface Category:

API.

Purpose:

Adds the object to its internal collection of objects. The implementation is left up to the derived class.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the object was successfully added.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardProducerConsumerQueue::HandleRemoveNext

virtual MCollectible * HandleRemoveNext ()

Interface Category:

API.

Purpose:

Removes the next object from the queue.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the next object on the queue.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardProducerConsumerQueue::HandleIsFull

virtual bool HandleIsFull ()

Interface Category:

API.

Purpose:

Derived classes of the producer consumer queue should override this member function to return true if they can no longer accept objects. This is called every time an object is removed from the queue to determine when space becomes available.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the queue is full.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TStandardProducerConsumerQueue::HandleCount

virtual unsigned long HandleCount () const

Interface Category:

API.

Purpose:

Used by the Count member function to obtain the actual number of objects in the queue.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the number of objects in the 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.