async::worker_t Class Reference

Describes a workload that returns results to be consumed and processed by the caller, that will be dispatched as a heap- allocated object. More...

#include <async-worker.h>

Inherits async::workload_t.

Inherited by Crunch, and CrunchNumbersRange.

List of all members.

Public Member Functions

 worker_t ()
 Constructor.

Detailed Description

Describes a workload that returns results to be consumed and processed by the caller, that will be dispatched as a heap- allocated object.

Once dispatched, each async::worker_t increments the pending result counter. To retrieve completed workloads, call async::GetResults(). Implement member function "void Work()" with your workload, and implement "void Result()" with your code for receiving the returned results.

Warning:
Assumes heap-allocation with 'new'.
Instances will attempt to 'delete' themseleves upon completion. If this behavior is not desired, use async::static_worker_t instead.
See also:
async::FireAndForget
async::static_worker_t
async::GetResults()
async::PendingResults()

Definition at line 274 of file async-worker.h.


Constructor & Destructor Documentation

async::worker_t::worker_t (  )  [inline]

Constructor.

Definition at line 278 of file async-worker.h.


The documentation for this class was generated from the following file:
Generated on Fri Jul 30 16:14:59 2010 for Async::Worker by  doxygen 1.6.3