#include <OTC/dispatch/job.hh> class OTC_Job {
public:
virtual ~OTC_Job();
inline void* operator new(size_t theSize);
inline void operator delete(void* theMemory, size_t theSize);
virtual void execute() = 0;
virtual void destroy();
protected:
inline OTC_Job();
};
OTC_Job
is the base class for any jobs to be executed by the
dispatcher. Derived classes must override the execute()
function
to perform the actual work. The dispatcher will call destroy()
once the job has executed. The default action of destroy()
is to
delete the object; this can be overridden in a derived class if
necessary.
Space for any derived classes is allocated from OTC_CommonPool
.
virtual void execute() = 0;
virtual void destroy();
OTC_JobQueue
, OTC_Dispatcher
, OTC_CommonPool