opensurgsim
|
A class implementing the thread context for sampling RawMultiAxis devices. More...
#include <RawMultiAxisThread.h>
Public Member Functions | |
RawMultiAxisThread (RawMultiAxisScaffold *scaffold, RawMultiAxisScaffold::DeviceData *deviceData) | |
![]() | |
BasicThread (const std::string &name="Unknown Thread") | |
virtual | ~BasicThread () noexcept(false) |
C++11 introduced noexcept. | |
void | start (std::shared_ptr< Barrier > startupBarrier=nullptr, bool isSynchronous=false) |
Live cycle functions, public implementation. More... | |
void | stop () |
Stopping the execution, blocks until the running thread has actually stopped,. More... | |
void | setIdle (bool isIdle) |
Set/Unset the thread in an idle state (doUpdate() called or not in the update() method) More... | |
bool | isIdle () |
Query if this thread is in idle state or not. More... | |
bool | isInitialized () |
Query if this object is initialized. More... | |
bool | isRunning () const |
Query if this object is running. More... | |
void | operator() () |
This is what boost::thread executes on thread creation. | |
boost::thread & | getThread () |
std::string | getName () const |
void | setRate (double val) |
Set the update rate of the thread. More... | |
bool | setSynchronous (bool val) |
Sets the thread to synchronized execution in concert with the startup barrier, the startup barrier has to exist for this call to succeed. More... | |
bool | isSynchronous () |
Query if this object is synchronized. More... | |
double | getCpuTime () const |
size_t | getUpdateCount () const |
void | resetCpuTimeAndUpdateCount () |
Reset the cpu time and the update count to 0. | |
bool | ignoresExceptions () const |
void | setIgnoreExceptions (bool val) |
Protected Member Functions | |
bool | doInitialize () override |
bool | doStartUp () override |
bool | doUpdate (double dt) override |
Implementation of actual work function for this thread, this has a default implementation to handle destruction better, as it could be called while the thread is under destruction, if left unimplemented this would trigger a call to a pure virtual function. More... | |
void | doBeforeStop () override |
Prepares the thread for its execution to be stopped. More... | |
![]() | |
bool | initialize () |
Trigger the initialization of this object, this will be called before all other threads doStartup() are called. More... | |
bool | startUp () |
Trigger the startup of this object, this will be called after all other threads doInit() was called the thread will only enter the run loop triggering upated() if all threads doInit() and doStartup() returned true. More... | |
bool | waitForBarrier (bool success) |
virtual bool | executeInitialization () |
Additional Inherited Members | |
![]() | |
Timer | m_timer |
Timer to measure the actual time taken to doUpdate. | |
std::shared_ptr< SurgSim::Framework::Logger > | m_logger |
Logger for this thread. | |
A class implementing the thread context for sampling RawMultiAxis devices.
|
overrideprotectedvirtual |
Prepares the thread for its execution to be stopped.
Reimplemented from SurgSim::Framework::BasicThread.
|
overrideprotectedvirtual |
Implementation of actual work function for this thread, this has a default implementation to handle destruction better, as it could be called while the thread is under destruction, if left unimplemented this would trigger a call to a pure virtual function.
Reimplemented from SurgSim::Framework::BasicThread.