Scopira
20080306
|
#include <task.h>
Public Types | |
enum | { run_done_c = 0, run_again_0_c = 0x1, run_again_1_c = 0x2, run_again_10_c = 0x3, run_again_100_c = 0x4, run_canmove_c = 0x100, run_onmsg_c = 0x200 } |
Public Member Functions | |
virtual int | run (scopira::agent::task_context &ctx)=0 |
Public Member Functions inherited from scopira::tool::object | |
virtual | ~object () |
int | add_ref (void) const |
bool | sub_ref (void) const |
void | auto_ref (void) const |
int | current_ref (void) const |
virtual scopira::tool::oflow_i & | print (scopira::tool::oflow_i &o) const |
virtual bool | load (scopira::tool::iobjflow_i &in) |
virtual void | save (scopira::tool::oobjflow_i &out) const |
bool | is_alive_object (void) const |
bool | is_dead_object (void) const |
Additional Inherited Members | |
Protected Member Functions inherited from scopira::tool::object | |
object (void) | |
object (bool neverusecounter) | |
A simple task that once started, does no communication with other tasks.
Basically, the creator instantiates an instance, populates any member variables, and then hands it off to the launch() method.
Because these tasks don't do any communication, they may also be checkedpointed and recoverable. That is, they may be restarted at the last saved state if a running process is lost on a dead machine.
|
pure virtual |
The run method for the task.
The implementation should do some work and return. It should return false if there is no more work to do (ie. return true if the run method should be run again).
You should try to return once in awhile through the executation of your task, as scopira can only move tasks between run calls.