Go to the first, previous, next, last section, table of contents.


CNQueueSPT -- SPT queue

SYNOPSIS

#include <CNCL/QueueSPT.h>

TYPE

CN_QUEUESPT

BASE CLASSES

CNQueue

DERIVED CLASSES

None

RELATED CLASSES

CNDLList, CNQueueFIFO, CNQueueLIFO, CNQueueRandom, CNPrioQueueFIFO, CNSink, CNJob, CNStack

DESCRIPTION

CNQueueSPT is a queue, implemented as a doubly linked list, that can contain any number (well, sort of ... ;-) CNCL compatible (restrictions see below) objects. The queueing strategy is SPT, that means jobs with the shortest processing time are delivered first. The processing time is read from the public identifier length of the CNJob object. SPT queues only accept objects derived from CNJob.

Constructors:

CNQueueSPT();
CNQueueSPT(CNParam *param);
Initialize the SPT-queue to an empty state.

In addition to the member functions required by CNCL, CNQueueSPT provides:

virtual bool empty() const;
Returns TRUE, if the queue is empty.
virtual bool full() const;
Always returns FALSE.
virtual int length() const;
Returns the actual queue length.
virtual void put(CNObject *obj);
Puts an object into the queue. Only objects derived from CNJob may be put into a SPT queue.
virtual CNObject *get();
Retrieves the object with the shortest processing time from the queue.
virtual CNObject *peek();
Retrieves the object with the shortest processing time from the queue. Unlike get(), the object is not removed from the queue.
virtual void delete_all();
Deletes all objects in the queue.


Go to the first, previous, next, last section, table of contents.