#include <coherence/util/Queue.hpp>
Inherits Object.
Inherited by AbstractConcurrentQueue [virtual]
.
Public Types | |
typedef spec::Handle | Handle |
Queue Handle definition. | |
typedef spec::View | View |
Queue View definition. | |
typedef spec::Holder | Holder |
Queue Holder definition. | |
Public Member Functions | |
virtual bool | add (Object::Holder oh)=0 |
Appends the specified element to the end of this queue. | |
virtual bool | addHead (Object::Holder oh)=0 |
Insert the specified element to the front of this queue. | |
virtual void | flush ()=0 |
Flush the queue. | |
virtual bool | isEmpty () const =0 |
Determine whether the Queue is empty or not. | |
virtual Object::Holder | peekNoWait ()=0 |
Returns the first element from the front of this Queue. | |
virtual Object::Holder | remove ()=0 |
Waits for and removes the first element from the front of this Queue. | |
virtual Object::Holder | removeNoWait ()=0 |
Removes and returns the first element from the front of this Queue. | |
virtual size32_t | size () const =0 |
Determine the number of elements in this Queue. |
virtual bool add | ( | Object::Holder | oh | ) | [pure virtual] |
Appends the specified element to the end of this queue.
Queues may place limitations on what types of elements may be added and should clearly specify in their documentation any restrictions.
oh | element to be appended to this Queue |
ClassCastException | if the class of the specified element prevents it from being added to this Queue |
Implemented in DualQueue.
virtual bool addHead | ( | Object::Holder | oh | ) | [pure virtual] |
Insert the specified element to the front of this queue.
Queues may place limitations on what types of elements may be added and should clearly specify in their documentation any restrictions.
oh | element ot be prepended to this Queue |
ClassCastException | if the class of the specified element prevents it from being added to this Queue |
Implemented in DualQueue.
virtual bool isEmpty | ( | ) | const [pure virtual] |
virtual Object::Holder peekNoWait | ( | ) | [pure virtual] |
Returns the first element from the front of this Queue.
There is no blocking equivalent of this method as it would require notification to wake up from an empty Queue, and this would mean that the "add" and "addHead" methods would need to perform notifyAll over notify which has performance implications.
Implemented in DualQueue.
virtual Object::Holder remove | ( | ) | [pure virtual] |
Waits for and removes the first element from the front of this Queue.
If the Queue is empty, this method will block until an element is in the Queue. The unblocking equivalent of this method is "removeNoWait".
Implemented in AbstractConcurrentQueue.
virtual Object::Holder removeNoWait | ( | ) | [pure virtual] |
virtual size32_t size | ( | ) | const [pure virtual] |
Determine the number of elements in this Queue.
The size of the Queue may change after the size is returned from this method.
Implemented in AbstractConcurrentQueue.