libmoost
moost::thread::job_batch Class Reference

#include <job_batch.hpp>

Inheritance diagram for moost::thread::job_batch:

List of all members.

Public Types

typedef boost::function0< void > job_t

Public Member Functions

virtual ~job_batch ()
virtual void add (job_t job)=0

Detailed Description

Interface for classes implementing a job batch

The abstract interface of a job batch is fairly simple as it's sole purpose is to allow new jobs to be added to the batch.

Definition at line 44 of file job_batch.hpp.


Member Typedef Documentation

typedef boost::function0<void> moost::thread::job_batch::job_t

Type representing a job to be run

A job is just a simple function object. It gets run in in a way determined by the concrete implementation of job_batch.

Definition at line 56 of file job_batch.hpp.


Constructor & Destructor Documentation

virtual moost::thread::job_batch::~job_batch ( ) [inline, virtual]

Definition at line 47 of file job_batch.hpp.


Member Function Documentation

virtual void moost::thread::job_batch::add ( job_t  job) [pure virtual]

Add a new job to the batch

This method adds a job to the concrete implementation. When this job gets run is determined by the implementation. However, new jobs may be added even while jobs from the current batch are being run as long as the batch doesn't run out of jobs. In particular, this means that it's always safe to add new jobs from within jobs of the current batch.

Parameters:
jobThe job to be added.

Implemented in moost::thread::threaded_job_batch, and moost::thread::simple_job_batch.


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