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


CNQueueRandom -- Random queue

SYNOPSIS

#include <CNCL/QueueRandom.h>

TYPE

CN_QUEUERANDOM

BASE CLASSES

CNQueue

DERIVED CLASSES

None

RELATED CLASSES

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

DESCRIPTION

CNQueueRandom is a queue, implemented as a doubly linked list, that can contain any number (well, sort of ... ;-) CNCL compatible objects. The queueing strategy is Random, that means there is no ordering in the queue.

Constructors:

CNQueueRandom();
CNQueueRandom(CNParam *param);
CNQueueRandom(CNRNG *rng);
Initialize the Random-queue to an empty state. One may provide a base random number generator (recommended!), otherwise the queue provides its own (default setting: CNFiboG.)

In addition to the member functions required by CNCL, CNQueueRandom 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.
virtual CNObject *get();
Retrieves a random object from the queue.
virtual CNObject *peek();
Retrieves an object 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.