CEBL
2.1
|
#include <TimeoutThread.hpp>
Public Member Functions | |
TimeoutThread () | |
virtual | ~TimeoutThread () |
bool | isHalted () |
bool | isStarted () |
double | getTimeoutLength () |
get length of timeout in milliseconds | |
void | setTimeoutLength (double l) |
set length of timeotu in milliseconds |
Protected Member Functions | |
virtual void | timeoutFunction ()=0 |
void | timeoutStart () |
start the thread | |
void | haltAndJoin () |
halt the thread and wait for it to finish | |
void | sleep (double stime) |
sleep for stime in milliseconds |
Protected Attributes | |
boost::thread * | updater_thread |
the thread object | |
bool | is_started |
flag to indicate whether or not the thread is started | |
bool | halt |
flag to order thread to halt on next iteration | |
bool | halted |
flag to indicate whether or not thread has hlated | |
boost::mutex | thread_lock |
mutex to lock the thread | |
double | timeout_length |
how often updater is called |
Friends | |
void | runTimeoutThread (TimeoutThread *) |
friend function to start timeout |
Simple interface for classes which require a function to be run as a timeout. Uses boost threading library.
Definition at line 34 of file TimeoutThread.hpp.
TimeoutThread::TimeoutThread | ( | ) |
Definition at line 16 of file TimeoutThread.cpp.
|
virtual |
Definition at line 27 of file TimeoutThread.cpp.
|
inline |
get length of timeout in milliseconds
Definition at line 74 of file TimeoutThread.hpp.
References timeout_length.
|
protected |
halt the thread and wait for it to finish
Definition at line 36 of file TimeoutThread.cpp.
Referenced by RealTimeClassification::stopClassifying().
|
inline |
Definition at line 71 of file TimeoutThread.hpp.
References halted.
|
inline |
Reimplemented in EEGDataStream.
Definition at line 72 of file TimeoutThread.hpp.
References is_started.
|
inline |
set length of timeotu in milliseconds
Definition at line 76 of file TimeoutThread.hpp.
References timeout_length.
|
protected |
sleep for stime in milliseconds
Definition at line 104 of file TimeoutThread.cpp.
|
protectedpure virtual |
Implemented in RealTimeClassification.
|
protected |
start the thread
Definition at line 57 of file TimeoutThread.cpp.
References cppR::bind(), and runTimeoutThread().
Referenced by RealTimeClassification::startClassifying().
|
friend |
friend function to start timeout
Definition at line 51 of file TimeoutThread.cpp.
|
protected |
flag to order thread to halt on next iteration
Definition at line 48 of file TimeoutThread.hpp.
Referenced by RealTimeClassification::timeoutFunction().
|
protected |
flag to indicate whether or not thread has hlated
Definition at line 50 of file TimeoutThread.hpp.
Referenced by isHalted().
|
protected |
flag to indicate whether or not the thread is started
Definition at line 46 of file TimeoutThread.hpp.
Referenced by EEGDataStream::isStarted(), and isStarted().
|
protected |
mutex to lock the thread
Definition at line 52 of file TimeoutThread.hpp.
Referenced by RealTimeClassification::clearClassificationQueue(), and RealTimeClassification::timeoutFunction().
|
protected |
how often updater is called
Definition at line 54 of file TimeoutThread.hpp.
Referenced by getTimeoutLength(), RealTimeClassification::RealTimeClassification(), and setTimeoutLength().
|
protected |
the thread object
Definition at line 44 of file TimeoutThread.hpp.