Producer Consumer
 All Classes Namespaces Files Functions Variables Properties
Public Member Functions | List of all members
producerConsumer.UnboundedBuffer Class Reference

A buffer with unlimited capacity. More...

Inherits producerConsumer.AbstractBuffer.

Public Member Functions

override 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...
 
override void Add (int element)
 Adds an element to the end of this buffer. More...
 
- Public Member Functions inherited from producerConsumer.AbstractBuffer
Boolean IsEmpty ()
 Returns true if the buffer is empty, false otherwise More...
 

Additional Inherited Members

- Protected Attributes inherited from producerConsumer.AbstractBuffer
readonly Queue< int > Queue = new Queue<int>()
 
- Properties inherited from producerConsumer.AbstractBuffer
int Count [get]
 
- Properties inherited from producerConsumer.IBuffer
int Count [get]
 The number of elements currently in the buffer More...
 

Detailed Description

A buffer with unlimited capacity.

Member Function Documentation

override void producerConsumer.UnboundedBuffer.Add ( int  element)
virtual

Adds an element to the end of this buffer.

Parameters
elementnew element to be added to this buffer

Implements producerConsumer.AbstractBuffer.

override int producerConsumer.UnboundedBuffer.Take ( )
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.AbstractBuffer.


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