lobot::Pause Class Reference

A Boolean flag to indicate whether threads should work as usual or wait until the application is unpaused. More...

#include <Robots/LoBot/thread/LoPause.H>

List of all members.

Public Member Functions

 ~Pause ()
 Clean-up.

Static Public Member Functions

static void set ()
static void clear ()
static void toggle ()
 Allow a thread to toggle the application's current pause state.
static bool is_set ()
 This function returns true if the application is currently paused.
static bool is_clear ()

Friends

class singleton< Pause >

Detailed Description

A Boolean flag to indicate whether threads should work as usual or wait until the application is unpaused.

This class holds a Boolean flag indicating whether the different Robolocust threads should suspend their normal operations or proceed normally. When this flag is set, all threads are required to stop doing their normal tasks such as reading sensors, issuing motor commands, etc. and idle until the pause flag is cleared.

Basically, this class serves to encapsulate an application-wide bool variable that is to be used in conjunction with a read/write lock.

Definition at line 88 of file LoPause.H.


Constructor & Destructor Documentation

lobot::Pause::~Pause (  ) 

Clean-up.

Definition at line 135 of file LoPause.C.


Member Function Documentation

void lobot::Pause::clear (  )  [static]

Allow a thread to signal all other threads that they should stop idling and resume normal operations.

Definition at line 102 of file LoPause.C.

Referenced by lobot::App::run().

static bool lobot::Pause::is_clear (  )  [inline, static]

This function returns true if the application is currently not paused.

Definition at line 127 of file LoPause.H.

References is_set().

Referenced by lobot::Arbiter::run(), lobot::App::run(), and lobot::Behavior::run().

bool lobot::Pause::is_set (  )  [static]

This function returns true if the application is currently paused.

Definition at line 122 of file LoPause.C.

Referenced by is_clear().

void lobot::Pause::set (  )  [static]

Allow a thread to signal all other threads that they should pause, i.e., suspend normal operations and idle.

Definition at line 93 of file LoPause.C.

Referenced by lobot::App::run().

void lobot::Pause::toggle (  )  [static]

Allow a thread to toggle the application's current pause state.

Definition at line 111 of file LoPause.C.


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:44:35 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3