EvolvingObjects
|
Contains all the required data and the functors to launch a job. More...
#include <eoMpi.h>
Public Member Functions | |
JobStore (SendTaskFunction< JobData > *stf, HandleResponseFunction< JobData > *hrf, ProcessTaskFunction< JobData > *ptf, IsFinishedFunction< JobData > *iff) | |
Default ctor with the 4 functors. | |
JobStore () | |
Empty ctor, useful for not forcing users to call the other constructor. | |
~JobStore () | |
Default destructor. | |
SendTaskFunction< JobData > & | sendTask () |
HandleResponseFunction< JobData > & | handleResponse () |
ProcessTaskFunction< JobData > & | processTask () |
IsFinishedFunction< JobData > & | isFinished () |
void | sendTask (SendTaskFunction< JobData > *stf) |
void | handleResponse (HandleResponseFunction< JobData > *hrf) |
void | processTask (ProcessTaskFunction< JobData > *ptf) |
void | isFinished (IsFinishedFunction< JobData > *iff) |
void | wrapSendTask (SendTaskFunction< JobData > *stf) |
Helpers for wrapping send task functor. | |
void | wrapHandleResponse (HandleResponseFunction< JobData > *hrf) |
Helpers for wrapping handle response functor. | |
void | wrapProcessTask (ProcessTaskFunction< JobData > *ptf) |
Helpers for wrapping process task functor. | |
void | wrapIsFinished (IsFinishedFunction< JobData > *iff) |
Helpers for wrapping is finished functor. | |
virtual JobData * | data ()=0 |
Protected Attributes | |
SendTaskFunction< JobData > * | _stf |
HandleResponseFunction< JobData > * | _hrf |
ProcessTaskFunction< JobData > * | _ptf |
IsFinishedFunction< JobData > * | _iff |
Contains all the required data and the functors to launch a job.
Splitting the functors and data from the job in itself allows to use the same functors and data for multiples instances of the same job. You define your store once and can use it a lot of times during your program. If the store was included in the job, you'd have to give again all the functors and all the datas to each invokation of the job.
Job store contains the 4 functors (pointers, so as to be able to wrap them ; references couldn't have permitted that) described above and the JobData used by all these functors. It contains also helpers to easily wrap the functors, getters and setters on all of them.
The user has to implement data(), which is the getter for retrieving JobData. We don't have any idea of who owns the data, moreover it is impossible to initialize it in this generic JobStore, as we don't know its form. As a matter of fact, the user has to define this in the JobStore subclasses.
eo::mpi::JobStore< JobData >::JobStore | ( | ) | [inline] |
eo::mpi::JobStore< JobData >::~JobStore | ( | ) | [inline] |