Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
xsens::WatchDogThread Class Reference

A class that keeps an eye on a threads timer. More...

#include <threading.h>

Public Member Functions

XsThreadId getThreadId (void) const
 
bool resetTimer (uint32_t timeout=0)
 Resets the timer and sets a timeout. More...
 
bool startTimer (uint32_t timeout=10000, const char *name=NULL)
 Starts a timer using some parameters. More...
 
bool stopTimer (void) noexcept
 Stops the timer. More...
 
 WatchDogThread (WatchDogFunction func, void *param=NULL)
 Constructor. More...
 
 ~WatchDogThread ()
 Destructor. More...
 

Private Member Functions

bool isAlive (void) volatile const noexcept
 
bool isRunning (void) volatile const noexcept
 
void threadMain (void)
 

Static Private Member Functions

static XSENS_THREAD_RETURN threadInit (void *obj)
 

Private Attributes

pthread_attr_t m_attr
 
WatchDogFunction m_func
 
Mutex m_mutex
 
char * m_name
 
void * m_param
 
bool m_reset
 
bool m_running
 
bool m_stop
 
XsThread m_thread
 
XsThreadId m_threadId
 
volatile std::atomic< std::uint32_tm_timeout
 

Detailed Description

A class that keeps an eye on a threads timer.

Definition at line 168 of file threading.h.

Constructor & Destructor Documentation

◆ WatchDogThread()

xsens::WatchDogThread::WatchDogThread ( WatchDogFunction  func,
void *  param = NULL 
)

Constructor.

Definition at line 461 of file threading.cpp.

◆ ~WatchDogThread()

xsens::WatchDogThread::~WatchDogThread ( )

Destructor.

Definition at line 483 of file threading.cpp.

Member Function Documentation

◆ getThreadId()

XsThreadId xsens::WatchDogThread::getThreadId ( void  ) const
inline
Returns
The thread ID

Definition at line 208 of file threading.h.

◆ isAlive()

bool xsens::WatchDogThread::isAlive ( void  ) const volatile
privatenoexcept

Definition at line 502 of file threading.cpp.

◆ isRunning()

bool xsens::WatchDogThread::isRunning ( void  ) const volatile
privatenoexcept

Definition at line 517 of file threading.cpp.

◆ resetTimer()

bool xsens::WatchDogThread::resetTimer ( uint32_t  timeout = 0)

Resets the timer and sets a timeout.

Parameters
timeoutThe timeout value to set
Returns
True if successful

Definition at line 739 of file threading.cpp.

◆ startTimer()

bool xsens::WatchDogThread::startTimer ( uint32_t  timeout = 10000,
const char *  name = NULL 
)

Starts a timer using some parameters.

Parameters
timeoutThe timeout value to use
nameThe name of a thread to set
Returns
True if successful

Definition at line 551 of file threading.cpp.

◆ stopTimer()

bool xsens::WatchDogThread::stopTimer ( void  )
noexcept

Stops the timer.

Returns
True if successful

Definition at line 591 of file threading.cpp.

◆ threadInit()

XSENS_THREAD_RETURN xsens::WatchDogThread::threadInit ( void *  obj)
staticprivate

Definition at line 661 of file threading.cpp.

◆ threadMain()

void xsens::WatchDogThread::threadMain ( void  )
private

Definition at line 671 of file threading.cpp.

Member Data Documentation

◆ m_attr

pthread_attr_t xsens::WatchDogThread::m_attr
private

Definition at line 177 of file threading.h.

◆ m_func

WatchDogFunction xsens::WatchDogThread::m_func
private

Definition at line 184 of file threading.h.

◆ m_mutex

Mutex xsens::WatchDogThread::m_mutex
private

Definition at line 178 of file threading.h.

◆ m_name

char* xsens::WatchDogThread::m_name
private

Definition at line 186 of file threading.h.

◆ m_param

void* xsens::WatchDogThread::m_param
private

Definition at line 185 of file threading.h.

◆ m_reset

bool xsens::WatchDogThread::m_reset
private

Definition at line 180 of file threading.h.

◆ m_running

bool xsens::WatchDogThread::m_running
private

Definition at line 179 of file threading.h.

◆ m_stop

bool xsens::WatchDogThread::m_stop
private

Definition at line 181 of file threading.h.

◆ m_thread

XsThread xsens::WatchDogThread::m_thread
private

Definition at line 171 of file threading.h.

◆ m_threadId

XsThreadId xsens::WatchDogThread::m_threadId
private

Definition at line 189 of file threading.h.

◆ m_timeout

volatile std::atomic<std::uint32_t> xsens::WatchDogThread::m_timeout
private

Definition at line 183 of file threading.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:23