Producer Consumer
 All Classes Namespaces Files Functions Variables Properties
Public Member Functions | Protected Attributes | Properties | List of all members
producerConsumer.AbstractBuffer Class Referenceabstract

Abstract class implementing the common parts of BoundedBuffer and UnboundedBuffer More...

Inherits producerConsumer.IBuffer.

Inherited by producerConsumer.BoundedBuffer, and producerConsumer.UnboundedBuffer.

Public Member Functions

abstract void Add (int element)
 Adds an element to the end of this buffer. More...
 
abstract int Take ()
 Removes and returns the first element from this buffer.
If the buffer is empty, the thread calling Tak() must wait until another thread Puts an element. More...
 
Boolean IsEmpty ()
 Returns true if the buffer is empty, false otherwise More...
 

Protected Attributes

readonly Queue< int > Queue = new Queue<int>()
 

Properties

int Count [get]
 
- Properties inherited from producerConsumer.IBuffer
int Count [get]
 The number of elements currently in the buffer More...
 

Detailed Description

Abstract class implementing the common parts of BoundedBuffer and UnboundedBuffer

Member Function Documentation

abstract void producerConsumer.AbstractBuffer.Add ( int  element)
pure virtual

Adds an element to the end of this buffer.

Parameters
elementnew element to be added to this buffer

Implements producerConsumer.IBuffer.

Implemented in producerConsumer.BoundedBuffer, and producerConsumer.UnboundedBuffer.

Boolean producerConsumer.AbstractBuffer.IsEmpty ( )

Returns true if the buffer is empty, false otherwise

Returns
true if the buffer is empty, false otherwise

Implements producerConsumer.IBuffer.

abstract int producerConsumer.AbstractBuffer.Take ( )
pure virtual

Removes and returns the first element from this buffer.
If the buffer is empty, the thread calling Tak() must wait until another thread Puts an element.

Returns
The first element from this buffer

Implements producerConsumer.IBuffer.

Implemented in producerConsumer.BoundedBuffer, and producerConsumer.UnboundedBuffer.

Member Data Documentation

readonly Queue<int> producerConsumer.AbstractBuffer.Queue = new Queue<int>()
protected

Property Documentation

int producerConsumer.AbstractBuffer.Count
get

The documentation for this class was generated from the following file: