A task is an database record of some experiment that we want to run. More...
#include <taskDispatcher.h>
Public Types | |
enum | Status { RUNNING, ERROR, DONE } |
Public Member Functions | |
db_planner::TaskRecord | getRecord () |
Returns a copy of the dbase record of this task. | |
Status | getStatus () |
Returns the current status of this task. | |
virtual void | start ()=0 |
Task (TaskDispatcher *disp, db_planner::DatabaseManager *mgr, db_planner::TaskRecord rec) | |
virtual | ~Task () |
Protected Attributes | |
db_planner::DatabaseManager * | mDBMgr |
A database mgr that can be used to access the dbase. | |
TaskDispatcher * | mDispatcher |
The Dispatcher that started this task. | |
db_planner::TaskRecord | mRecord |
The dbase record of the task being executed. | |
Status | mStatus |
The current status of this task. |
A task is an database record of some experiment that we want to run.
Usually, a task will involve an object, a hand, and some sort of experiment, such as planning grasps and recording them in the database. This class encapsulates a task, plus it offers some connections so that the task can be run automatically by a TaskDispatcher.
A Task is responsible for its own event management. It can use a callback system (i.e. surrender control and then get it back later via its own timers or callbacks). For example, this can be achieved by using one of the EGPlanners, which do that natively.
A Task must implement the following interface:
Definition at line 73 of file taskDispatcher.h.
enum Task::Status |
Definition at line 75 of file taskDispatcher.h.
Task::Task | ( | TaskDispatcher * | disp, | |
db_planner::DatabaseManager * | mgr, | |||
db_planner::TaskRecord | rec | |||
) | [inline] |
Definition at line 88 of file taskDispatcher.h.
virtual Task::~Task | ( | ) | [inline, virtual] |
Definition at line 90 of file taskDispatcher.h.
db_planner::TaskRecord Task::getRecord | ( | ) | [inline] |
Returns a copy of the dbase record of this task.
Definition at line 95 of file taskDispatcher.h.
Status Task::getStatus | ( | ) | [inline] |
Returns the current status of this task.
Definition at line 93 of file taskDispatcher.h.
virtual void Task::start | ( | ) | [pure virtual] |
Implemented in CompliantGraspCopyTask, GraspClusteringTask, GraspPlanningTask, GraspTransferCheckTask, PreGraspCheckTask, TableCheckTask, EmptyTask, and EmptyOneShotTask.
db_planner::DatabaseManager* Task::mDBMgr [protected] |
A database mgr that can be used to access the dbase.
Acquired from the TaskDispatcher
Definition at line 83 of file taskDispatcher.h.
TaskDispatcher* Task::mDispatcher [protected] |
The Dispatcher that started this task.
Definition at line 80 of file taskDispatcher.h.
db_planner::TaskRecord Task::mRecord [protected] |
The dbase record of the task being executed.
Definition at line 85 of file taskDispatcher.h.
Status Task::mStatus [protected] |
The current status of this task.
Definition at line 78 of file taskDispatcher.h.