Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MCollectible
Inherited By:
None.
Purpose:
This allows derived classes of producer consumer queue to define additional distinguishing criteria for removing objects. By deriving this, a producer consumer queue derived class could allow its clients to remove objects from its queue that meet certain additional conditions.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
This class is derived to define criteria for removing objects from the queue.
Concurrency:
Multithread safe.
Resource Use:
No special requirements.
TProducerConsumerCondition (TProducerConsumerQueue *)
Interface Category:
API.
Purpose:
Constructs a condition for use with the given queue. The queue is aliased, not adopted.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
~ TProducerConsumerCondition ()
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.
virtual MCollectible * RemoveNext ()
Interface Category:
API.
Purpose:
Returns the next available object that meets the specified condition.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Removes and returns an object on the queue.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void WaitUntilSatisfied ()
Interface Category:
API.
Purpose:
Blocks until there is an object on the queue that satisfies the condition. It does not remove the object.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool ShouldUnblockConsumer (const MCollectible &)
Interface Category:
API.
Purpose:
Implementors of new conditions must override this member function. It returns true if the consumer should be notified that the passed in object is the kind of object that they need.
Calling Context:
Call this function directly.
Parameters:
- const MCollectible & -The object checked for satifying condition.
Return Value:
Returns true if the object meets the criteria for this condition.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
void AddedElement (const MCollectible &)
Interface Category:
API.
Purpose:
Called by the producer consumer queue, each time it adds a new element to its queue. The condition is given an opportunity to wake up any clients so that they can remove the object from the queue.
Calling Context:
Call this function directly.
Parameters:
- const MCollectible & -The object checked for satisfying condition.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual long Hash () const
Interface Category:
API.
Purpose:
Generates a hash value for collection classes.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a hash value.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
- void Wait ()
- void Wait (const TTime & MaximumWait)
Interface Category:
API.
Purpose:
- Waits until the condition is satisfied.
- Waits until the condition is satisfied or the timeout occurs.
Calling Context:
- Call this function directly.
- Call this function directly.
Parameters:
- Takes no parameters.
- const TTime & MaximumWait -The timeout value.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None
virtual void Continue ()
Interface Category:
API.
Purpose:
Called to indicate that the condition is satisfied.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
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.