LoopThreadObj Class Reference

Class to execute a loop in a separate thread. More...

#include <loop_thread_obj.h>

Inheritance diagram for LoopThreadObj:

Inheritance graph
[legend]
Collaboration diagram for LoopThreadObj:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 LoopThreadObj (const std::string)
virtual ~LoopThreadObj ()
void Main ()
 Main method executed in a separate thread.
unsigned int GetSleepTime ()
 Get the current delay between each loop execution.

Protected Member Functions

virtual void Loop ()=0
 Thread loop.
void WakeUp ()
 Wake up the loop.


Detailed Description

Class to execute a loop in a separate thread.

This class can be used to execute a loop in a separate thread. A delay is introduced between each loop to decrease it execution rate, when it's not used.

Definition at line 31 of file loop_thread_obj.h.


Constructor & Destructor Documentation

LoopThreadObj::LoopThreadObj ( const std::string  n  ) 

Definition at line 26 of file loop_thread_obj.cpp.

LoopThreadObj::~LoopThreadObj (  )  [virtual]

Definition at line 33 of file loop_thread_obj.cpp.


Member Function Documentation

unsigned int LoopThreadObj::GetSleepTime (  ) 

Get the current delay between each loop execution.

Returns:
the current delay between each loop execution.

Definition at line 76 of file loop_thread_obj.cpp.

virtual void LoopThreadObj::Loop (  )  [protected, pure virtual]

Thread loop.

Implements FastLoopThreadObj.

void LoopThreadObj::Main (  )  [virtual]

Main method executed in a separate thread.

This method is executed in a separate thread when a call to Start is done.

Reimplemented from FastLoopThreadObj.

Definition at line 52 of file loop_thread_obj.cpp.

void LoopThreadObj::WakeUp (  )  [protected]

Wake up the loop.

When called the execution rate of the loop is increased. After being waked up (or after the first start), the execution of the loop is delayed:

  • Of 1ms during the first 10 seconds.
  • The delay then increases linearily during 10 seconds to reach a level of a 0.1 second sleep time.
  • The delay then stays at 0.1 second.

Definition at line 44 of file loop_thread_obj.cpp.


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

Generated on Sun Oct 10 19:10:05 2010 for libldsw by  doxygen 1.5.8