All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
SurgSim::Device::LabJackThread Class Reference

A class implementing the thread context for communicating with LabJack devices. More...

#include <SurgSim/Devices/LabJack/LabJackThread.h>

Inheritance diagram for SurgSim::Device::LabJackThread:
Inheritance graph
[legend]
Collaboration diagram for SurgSim::Device::LabJackThread:
Collaboration graph
[legend]

Public Member Functions

 LabJackThread (LabJackScaffold *scaffold, LabJackScaffold::DeviceData *deviceData)
 
virtual ~LabJackThread ()
 
- Public Member Functions inherited from SurgSim::Framework::BasicThread
 BasicThread (const std::string &name="Unknown Thread")
 
virtual ~BasicThread () noexcept(false)
 C++11 introduced noexcept. More...
 
void start (std::shared_ptr< Barrier > startupBarrier=nullptr, bool isSynchronous=false)
 C++11 introduced noexcept. 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. More...
 
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...
 

Protected Member Functions

virtual bool doInitialize () override
 
virtual bool doStartUp () override
 
virtual 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...
 
- Protected Member Functions inherited from SurgSim::Framework::BasicThread
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 ()
 

Private Attributes

LabJackScaffoldm_scaffold
 
LabJackScaffold::DeviceDatam_deviceData
 

Detailed Description

A class implementing the thread context for communicating with LabJack devices.

See also
SurgSim::Device::LabJackScaffold

Constructor & Destructor Documentation

SurgSim::Device::LabJackThread::LabJackThread ( LabJackScaffold scaffold,
LabJackScaffold::DeviceData deviceData 
)
explicit
SurgSim::Device::LabJackThread::~LabJackThread ( )
virtual

Member Function Documentation

bool SurgSim::Device::LabJackThread::doInitialize ( )
overrideprotectedvirtual
bool SurgSim::Device::LabJackThread::doStartUp ( )
overrideprotectedvirtual
bool SurgSim::Device::LabJackThread::doUpdate ( double  dt)
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.

Returns
false when the thread is done, this will stop execution

Reimplemented from SurgSim::Framework::BasicThread.

Member Data Documentation

LabJackScaffold::DeviceData* SurgSim::Device::LabJackThread::m_deviceData
private
LabJackScaffold* SurgSim::Device::LabJackThread::m_scaffold
private

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