NAME
OTC_JobQueue -
Queue for holding jobs.
SYNOPSIS
#include <OTC/dispatch/jobqueue.hh>
class OTC_JobQueue
{
public:
virtual ~OTC_JobQueue();
void add(OTC_Job* theJob);
virtual OTC_Job* next();
};
CLASS TYPE
Concrete
DESCRIPTION
OTC_JobQueue holds jobs on behalf of the dispatcher. The default
implementation of the job queue adds new jobs to the end of the
queue and returns jobs from the front of the queue.
If you need to redefine the scheduling algorithm, you should
derive your own queue from this class and redefine next().
An example of a derived queue would be one that, before returning
a job from the queue, would check to see if any signals had
occurred that agents were interested in. Signals would be given a
higher priority than jobs already queued, so a new job
corresponding to the signal would be created and returned, instead
of getting the job from the front of the queue. The same queue
could also use the system select() or poll() function to
generate new jobs corresponding to I/O or timer events.
DESTRUCTION
virtual ~OTC_JobQueue();
Goes through the job queue, destroying
any jobs.
QUEUEING
void add(OTC_Job* theJob);
Adds a job to the end of the queue.
Generates an exception if theJob
is 0.
virtual OTC_Job* next();
Returns the job at the head of the queue.
Can be redefined in a derived class to
look for jobs elsewhere besides this
queue.
SEE ALSO
OTC_Dispatcher, OTC_Job
LIBRARY
OTC
AUTHOR(S)
Graham Dumpleton
COPYRIGHT
Copyright 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED