EvolvingObjects
eo::mpi::JobStore< JobData > Struct Template Reference

Contains all the required data and the functors to launch a job. More...

#include <eoMpi.h>

List of all members.

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

Detailed Description

template<typename JobData>
struct eo::mpi::JobStore< JobData >

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.

Definition at line 403 of file eoMpi.h.


Constructor & Destructor Documentation

template<typename JobData>
eo::mpi::JobStore< JobData >::JobStore ( ) [inline]

Empty ctor, useful for not forcing users to call the other constructor.

When using this constructor, the user have to care about the 4 functors pointers, otherwise null pointer segfaults have to be expected.

Definition at line 425 of file eoMpi.h.

template<typename JobData>
eo::mpi::JobStore< JobData >::~JobStore ( ) [inline]

Default destructor.

JobStore is the highest layer which calls needDelete on its functors.

Definition at line 435 of file eoMpi.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends