Queue class for objects derived from cObject.The default behavior of cQueue is a FIFO: you insert elements at the back using insert(), and remove them at the front using pop(). cQueue may be set up to act as a priority queue. This requires the user to supply a comparison function.

Constructors and destructors in Queue:

  • Constructor:

When comparison function argument is NULL, the queue will act as FIFO, otherwise as priority queue.

cQueue::cQueue(const cQueue &queue )
  • Copy constructor:

Contained objects that are owned by the queue will be duplicated so that the new queue will have its own copy of them.

virtual cQueue::~cQueue( )[virtual]
  • Destructor:

Deletes all contained objects that were owned by it.


Sample code for Queue:

network RingQueue
        source1: Source {
        source: Source {
        queue: Queue {
        queue1: Queue {
        queue2: Queue {
        queue3: Queue {
        queue4: Queue {
        queue4.out -->;
        queue.out -->;
        queue1.out -->;
        queue2.out -->;
        queue3.out -->;
        source.out -->;
        source1.out -->;