Public Member Functions | Protected Member Functions | Private Attributes | List of all members
MtThread Class Reference

A class that implements thread for MT. More...

#include <mtthread.h>

Inheritance diagram for MtThread:
Inheritance graph
[legend]

Public Member Functions

 MtThread (DataParser &fetcher, SerialCommunicator &communicator)
 Default constructor. More...
 
void setDoGotoConfig (bool doit)
 Set whether we should send gotoconfig here. More...
 
virtual ~MtThread (void)
 Destructor. More...
 
- Public Member Functions inherited from DataPoller
 DataPoller (DataParser &parser)
 Create a DataPoller with a parser. More...
 
virtual ~DataPoller ()
 Destroy the data poller. More...
 
- Public Member Functions inherited from xsens::StandardThread
XsThreadId getThreadId (void) const
 
bool isAlive (void) volatile const noexcept
 
bool isRunning (void) volatile const noexcept
 Returns whether the thread is currently running. More...
 
bool isTerminating () volatile const noexcept
 Returns whether the thread should (have) terminate(d) More...
 
bool setPriority (XsThreadPriority pri)
 Sets the priority of the thread. More...
 
virtual void signalStopThread (void)
 Tells the thread to stop but does not wait for it to end. More...
 
 StandardThread ()
 
bool startThread (const char *name=NULL)
 Starts the thread. More...
 
void stopThread (void) noexcept
 Tells the thread to stop and waits for it to end. More...
 
virtual ~StandardThread ()
 

Protected Member Functions

virtual int32_t innerFunction (void)
 The inner thread function. More...
 
- Protected Member Functions inherited from DataPoller
void cleanup ()
 Clean up the DataPoller. More...
 
virtual int32_t conjureUpWaitTime (const XsByteArray &bytes) const
 Conjure up the time to wait based on properties of the received data (like the length) More...
 
void initFunction () override
 Init function for the thread, sets the priority higher. More...
 
- Protected Member Functions inherited from xsens::StandardThread
virtual void exitFunction (void)
 Virtual exit function. More...
 
XsThread threadHandle () const
 Return the thread handle. More...
 

Private Attributes

SerialCommunicatorm_communicator
 
bool m_doGotoConfig
 
XsByteArraym_gotoConfigPlus
 

Additional Inherited Members

- Protected Attributes inherited from xsens::StandardThread
pthread_attr_t m_attr
 Duplicates m_stop functionality for external dependent classes such as Semaphore. More...
 
bool m_running
 Indicates that the thread is running. More...
 
volatile std::atomic_bool m_stop
 Indicates that the thread should stop. Derived classes should check isTerminating() instead of directly polling this value when checking if the thread should stop. However, there are some cases (tests, SignallingThread) where direct access from within the class is desired, which is why the vlaue is protected instead of private. More...
 
volatile std::atomic_bool m_yieldOnZeroSleep
 When true, a sleep value of 0 returned by innerFunction will trigger a thread yield operation. When false, the next cycle is started immediately. More...
 

Detailed Description

A class that implements thread for MT.

Definition at line 74 of file mtthread.h.

Constructor & Destructor Documentation

◆ MtThread()

MtThread::MtThread ( DataParser fetcher,
SerialCommunicator communicator 
)
explicit

Default constructor.

Definition at line 77 of file mtthread.cpp.

◆ ~MtThread()

MtThread::~MtThread ( void  )
virtual

Destructor.

Definition at line 91 of file mtthread.cpp.

Member Function Documentation

◆ innerFunction()

int32_t MtThread::innerFunction ( void  )
protectedvirtual

The inner thread function.

This function handles port communication, delegating processing and calibration to its DataParser.

Returns
A value from 0 to 3

Reimplemented from DataPoller.

Definition at line 115 of file mtthread.cpp.

◆ setDoGotoConfig()

void MtThread::setDoGotoConfig ( bool  doit)

Set whether we should send gotoconfig here.

Definition at line 105 of file mtthread.cpp.

Member Data Documentation

◆ m_communicator

SerialCommunicator* MtThread::m_communicator
private

Definition at line 87 of file mtthread.h.

◆ m_doGotoConfig

bool MtThread::m_doGotoConfig
private

Definition at line 86 of file mtthread.h.

◆ m_gotoConfigPlus

XsByteArray* MtThread::m_gotoConfigPlus
private

Definition at line 88 of file mtthread.h.


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


xsens_mti_driver
Author(s):
autogenerated on Sun Sep 3 2023 02:43:22