VPTissue Reference Manual
|
Contains information about task in an exploration. More...
#include <ExplorationTask.h>
Public Member Functions | |
ExplorationTask () | |
Constructs a task in 'Waiting' state. | |
ExplorationTask (const boost::property_tree::ptree &pt) | |
Constructor. More... | |
virtual | ~ExplorationTask () |
Destructor. | |
void | ChangeState (const TaskState &state) |
Change the state of the task. More... | |
std::string | getNodeIp () const |
int | getNodePort () const |
unsigned int | GetNumberOfTries () const |
Returns the number of tries. | |
unsigned int | GetRunningTime () const |
Returns the time the task has run. More... | |
TaskState | GetState () const |
Gets the state of the task. More... | |
void | IncrementTries () |
Increment the tries of running the task. | |
void | setNodeThatContainsResult (const std::string nodeIP, int nodePort) |
boost::property_tree::ptree | ToPtree () const |
Convert the task to a ptree. More... | |
Contains information about task in an exploration.
Definition at line 42 of file ExplorationTask.h.
SimPT_Parex::ExplorationTask::ExplorationTask | ( | const boost::property_tree::ptree & | pt | ) |
Constructor.
Constructs an exploration task with the given pt. See ToPtree() for more information about the format of such a tree.
ptree_bad_data | When the ptree doesn't have the correct data. |
ptree_bad_path | When the ptree doesn't have the correct format. |
Definition at line 33 of file ExplorationTask.cpp.
void SimPT_Parex::ExplorationTask::ChangeState | ( | const TaskState & | state | ) |
Change the state of the task.
When the new state is 'Running', the timer will start tracking. When the new state is 'Finished', the timer will be frozen and the state can't be changed anymore.
state | The new state of the task. |
Definition at line 42 of file ExplorationTask.cpp.
References SimPT_Parex::Failed, SimPT_Parex::Finished, and SimPT_Parex::Running.
unsigned int SimPT_Parex::ExplorationTask::GetRunningTime | ( | ) | const |
Returns the time the task has run.
This includes the time from the first 'Running' state of the task till the task has finished.
Definition at line 66 of file ExplorationTask.cpp.
References SimPT_Parex::Running.
|
inline |
Gets the state of the task.
Definition at line 76 of file ExplorationTask.h.
ptree SimPT_Parex::ExplorationTask::ToPtree | ( | ) | const |
Convert the task to a ptree.
The format of such a ptree is: <state>m_state</state> <start_time>m_start_time</start_time> <running_time>m_running_time</running_time> <tries>m_tries</tries>
Definition at line 98 of file ExplorationTask.cpp.
Referenced by SimPT_Parex::ExplorationProgress::ToPtree().