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

RWTPCValBufferBaseGuardedPrioritized<Type,GuardAndPriorityDecorator>

Module:  Threads   Package:  Interthread Communication


RWTPCValBufferBaseGuarded<Type,GuardAndPriorityDecorator> RWTPCValBufferBaseGuardedPrioritized<Type,GuardAndPriorityDecorator> RWTPCValBufferBasePrioritized<Type,GuardAndPriorityDecorator>

Local Index

Members

Header File

#include <rw/itc/RWTPCValBufferBaseGuardedPrioritized.h> 

Description

RWTPCValBufferBaseGuardedPrioritized<...> is the base class for the family of classes that provide buffered producer-consumer synchronization semantics exchanging guarded and prioritized values between cooperating threads.

In the producer-consumer synchronization model, reader threads (consumers) are blocked while a buffer is empty, and writer threads (producers) are blocked while a buffer is full. A buffer is considered full when the number of unread entries equals or exceeds some user-specified maximum capacity.

The write operations provided by this class and its subclasses bind additional data items to each value prior to storing that value in an internal buffer. These additional data items, or decorations, include a guard functor instance and a priority value. The guard functor is used during read operations to determine whether the associated value is currently eligible for retrieval from the buffer. The priority value is used during write operations to determine a value's insertion point within the buffer, such that the set of unread values will be retrieved in priority order when eventually read from the buffer. The template parameter GuardAndPriorityDecorator identifies the class that is used to encapsulate the data value, guard functor, and priority value as a single object for storage in the internal buffer. The decorator class used by subclasses to instantiate this class is intended for the module's internal use, and is not documented as part of the public interface.

Public Destructor

virtual
~RWTPCValBufferBaseGuardedPrioritized();

Inherited Functions

The following superclass functions have been redeclared or redefined to allow them to be overloaded within in this class:

bool         tryWrite(const Type& value);
void         write(const Type& value);
RWWaitStatus write(const Type& value,
                   unsigned long milliseconds);
bool         tryWrite(const Type& value, 
                      const RWTFunctorR0<bool>& guard);
void         write(const Type& value, 
                   const RWTFunctorR0<bool>& guard);
RWWaitStatus write(const Type& value, 
                   const RWTFunctorR0<bool>& guard,
                   unsigned long milliseconds);
bool         tryWrite(long priority, const Type& value);
void         write(long priority, const Type& value);
RWWaitStatus write(long priority, const Type& value, 
                   unsigned long milliseconds);

Public Member Functions

bool 
tryWrite(long priority, const Type& value,
         const RWTFunctorR0<bool>& guard);
void 
write(long priority, const Type& value,
      const RWTFunctorR0<bool>& guard);
RWWaitStatus 
write(long priority, const Type& value,
      const RWTFunctorR0<bool>& guard,
      unsigned long milliseconds);

See Also

RWTPCValBufferBaseGuarded<Type,GuardDecorator>, RWTPCValBufferBasePrioritized<Type,PriorityDecorator>, RWTPCValQueueGuardedPrioritized<Type>, RWTPCValStackGuardedPrioritized<Type>



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.