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... | |
Abstract class implementing the common parts of BoundedBuffer and UnboundedBuffer
|
pure virtual |
Adds an element to the end of this buffer.
element | new 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
Implements producerConsumer.IBuffer.
|
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.
Implements producerConsumer.IBuffer.
Implemented in producerConsumer.BoundedBuffer, and producerConsumer.UnboundedBuffer.
|
protected |
|
get |