libbbb  1.2.1
Groups common code used in some applications and libraries.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
bbb::JobInterf Class Referenceabstract

This class represents the interface for a job. More...

#include <jobinterf.h>

+ Inheritance diagram for bbb::JobInterf:

Public Types

typedef void(* KbTimeout )(JobInterf *job)
 the function to call when the timeout expires
 

Public Member Functions

 JobInterf (void)
 constructor;
 
virtual ~JobInterf (void)
 destructor;
 
virtual bool startJob (void)=0
 start the job
 
virtual void stopJob (void)=0
 stop the job
 
virtual bool isJobRunning (void) const =0
 tell if the job is running
 
virtual int frequency (void) const
 frequency in miliseconds
 
virtual void setFrequency (int milisec)
 set the frequency
 
void setCallback (KbTimeout val)
 sets the callback to use
 
KbTimeout callback (void)
 retrieves the callback used
 

Public Attributes

Amorph a0_
 associated data
 

Protected Attributes

KbTimeout kb_
 the function to call when the timeout expires
 
int freq_msec_
 the frequency
 

Detailed Description

This class represents the interface for a job.

A job may be carried out as a background job, as a worker thread or as a pool or worker threads, among others. What all these have in common is that they call a user provided callback at regular intervals or countinously (back job actually fakes this behaviour).

This class provides an unified interface for these (and others) workers.


The documentation for this class was generated from the following files: