ompl::base::PlannerThreadedTerminationCondition Class Reference

Termination condition with lazy evaluation. This is just as a regular termination condition, except the condition is actually evaluated by computeEval() and the return value is stored in evalValue_. Every time eval() is called, evalValue_ is returned instead of actually evaluating the termination condition. Furthermore, the termination condition is evaluated every period_ seconds in a separate thread. The thread automatically starts when the condition is constructed and it terminates when the condition becomes true. More...

#include <PlannerTerminationCondition.h>

Inheritance diagram for ompl::base::PlannerThreadedTerminationCondition:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual bool eval (void) const
 Simply return the cached value for the termination condition (evalValue_).
 PlannerThreadedTerminationCondition (const PlannerTerminationConditionFn &fn, double period)
 Construct a termination condition that is evaluated every period seconds. The evaluation of the condition (the call to computeEval()) consists of calling fn().
 PlannerThreadedTerminationCondition (double period)
 Construct a termination condition that is evaluated every period seconds. An implementation of computeEval() other than the default needs to be provided.
virtual void terminate (bool flag)
 Notify that the condition for termination should become true, regardless of what eval() returns. Furthermore, if flag is true and the thread evaluating the termination condition is active, the thread is terminated. The tread will be restarted if flag = false is passed.
virtual ~PlannerThreadedTerminationCondition (void)

Protected Member Functions

virtual bool computeEval (void)
 Evaluate the termination condition. By default this is a call to fn_() from the base class.
void periodicEval (void)
 Worker function that runs in a separate thread (calls computeEval()).
void startEvalThread (void)
 Start the thread evaluating termination conditions if not already started.
void stopEvalThread (void)
 Stop the thread evaluating termination conditions if not already stopped.

Protected Attributes

bool evalValue_
 Cached value returned by computeEval().
double period_
 Interval of time (seconds) to wait between calls to computeEval().
boost::thread * thread_
 Thread for periodicEval().

Detailed Description

Termination condition with lazy evaluation. This is just as a regular termination condition, except the condition is actually evaluated by computeEval() and the return value is stored in evalValue_. Every time eval() is called, evalValue_ is returned instead of actually evaluating the termination condition. Furthermore, the termination condition is evaluated every period_ seconds in a separate thread. The thread automatically starts when the condition is constructed and it terminates when the condition becomes true.

Definition at line 124 of file PlannerTerminationCondition.h.


Constructor & Destructor Documentation

ompl::base::PlannerThreadedTerminationCondition::PlannerThreadedTerminationCondition ( double  period  ) 

Construct a termination condition that is evaluated every period seconds. An implementation of computeEval() other than the default needs to be provided.

ompl::base::PlannerThreadedTerminationCondition::PlannerThreadedTerminationCondition ( const PlannerTerminationConditionFn fn,
double  period 
)

Construct a termination condition that is evaluated every period seconds. The evaluation of the condition (the call to computeEval()) consists of calling fn().

virtual ompl::base::PlannerThreadedTerminationCondition::~PlannerThreadedTerminationCondition ( void   )  [virtual]

Member Function Documentation

virtual bool ompl::base::PlannerThreadedTerminationCondition::computeEval ( void   )  [protected, virtual]

Evaluate the termination condition. By default this is a call to fn_() from the base class.

virtual bool ompl::base::PlannerThreadedTerminationCondition::eval ( void   )  const [virtual]

Simply return the cached value for the termination condition (evalValue_).

Reimplemented from ompl::base::PlannerTerminationCondition.

void ompl::base::PlannerThreadedTerminationCondition::periodicEval ( void   )  [protected]

Worker function that runs in a separate thread (calls computeEval()).

void ompl::base::PlannerThreadedTerminationCondition::startEvalThread ( void   )  [protected]

Start the thread evaluating termination conditions if not already started.

void ompl::base::PlannerThreadedTerminationCondition::stopEvalThread ( void   )  [protected]

Stop the thread evaluating termination conditions if not already stopped.

virtual void ompl::base::PlannerThreadedTerminationCondition::terminate ( bool  flag  )  [virtual]

Notify that the condition for termination should become true, regardless of what eval() returns. Furthermore, if flag is true and the thread evaluating the termination condition is active, the thread is terminated. The tread will be restarted if flag = false is passed.

Reimplemented from ompl::base::PlannerTerminationCondition.


Member Data Documentation

Cached value returned by computeEval().

Definition at line 171 of file PlannerTerminationCondition.h.

Interval of time (seconds) to wait between calls to computeEval().

Definition at line 174 of file PlannerTerminationCondition.h.

Thread for periodicEval().

Definition at line 168 of file PlannerTerminationCondition.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


ompl
Author(s): Ioan Sucan/isucan@rice.edu, Mark Moll/mmoll@rice.edu, Lydia Kavraki/kavraki@rice.edu
autogenerated on Fri Jan 11 09:34:00 2013