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();

QUEUEING

void add(OTC_Job* theJob);
virtual OTC_Job* next();

SEE ALSO

OTC_Dispatcher, OTC_Job

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED