VPTissue Reference Manual
SimPT_Parex::ExplorationTask Class Reference

Contains information about task in an exploration. More...

#include <ExplorationTask.h>

Collaboration diagram for SimPT_Parex::ExplorationTask:
Collaboration graph

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...
 

Detailed Description

Contains information about task in an exploration.

Definition at line 42 of file ExplorationTask.h.

Constructor & Destructor Documentation

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.

Exceptions
ptree_bad_dataWhen the ptree doesn't have the correct data.
ptree_bad_pathWhen the ptree doesn't have the correct format.

Definition at line 33 of file ExplorationTask.cpp.

Member Function Documentation

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.

Parameters
stateThe 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.

Returns
The time in seconds.

Definition at line 66 of file ExplorationTask.cpp.

References SimPT_Parex::Running.

TaskState SimPT_Parex::ExplorationTask::GetState ( ) const
inline

Gets the state of the task.

Returns
The state of this 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().

Here is the caller graph for this function:


The documentation for this class was generated from the following files: