Protocols::Generics::DataQueue Class Reference

#include <DataQueue.h> [code]

Inherited by Protocols::Generics::FifoQueue.

Inheritance diagram for Protocols::Generics::DataQueue:

Inheritance graph
[legend]
List of all members.

Detailed Description

Interface DataQueue - Data queueing strategy.

A common problem when sending data over the network is trying to send data faster than the network or the other side can manage to transmit or process. In case the network bandwidth is saturated certain data might need to be sent with higher priority while less important data could be dropped.

DataQueue provides an abstraction for a queueing strategy. A new object that gets enqueued might be queued, or dropped. Another already queued object may be dropped to make room for the new one. Each DataQueue implementation could implement its own queueing policy.

Definition at line 44 of file DataQueue.h.

Public Member Functions

virtual ~DataQueue ()
virtual bool isEmpty () const =0
 Tells whether any elements are queued or not.
virtual void enqueue (const Data &)=0
 Adds a Data object to the queue.
virtual Data next () const =0
virtual void dequeue ()=0
 Drops the Data objects that is next() in the queue.


Constructor & Destructor Documentation

virtual Protocols::Generics::DataQueue::~DataQueue  )  [inline, virtual]
 

Definition at line 49 of file DataQueue.h.


Member Function Documentation

void DataQueue::dequeue  )  [pure virtual]
 

Drops the Data objects that is next() in the queue.

Note:
You would normally call next() first and would then call dequeue() next only if the Data object need not be buffered any longer (e.g it was sent over the network).

Implemented in Protocols::Generics::FifoQueue.

void DataQueue::enqueue const Data data  )  [pure virtual]
 

Adds a Data object to the queue.

Parameters:
data is the Data object to add to the queue.

Implemented in Protocols::Generics::FifoQueue.

bool DataQueue::isEmpty  )  const [pure virtual]
 

Tells whether any elements are queued or not.

Returns:
true if at least one Data object is queued.

false if no Data objects are queued.

Implemented in Protocols::Generics::FifoQueue.

virtual Data Protocols::Generics::DataQueue::next  )  const [pure virtual]
 

Implemented in Protocols::Generics::FifoQueue.


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