Public Member Functions | Public Attributes | Private Member Functions | List of all members
SickThread< T, M > Class Template Reference

Wrapper class for posix threads. More...

#include <SickThread.hpp>

Inheritance diagram for SickThread< T, M >:
Inheritance graph
[legend]

Public Member Functions

void join ()
 
 SickThread (const std::string &thread_name="")
 
virtual ~SickThread ()
 
- Public Member Functions inherited from ThreadWrapperBase
std::thread * get_thread_id ()
 
bool isRunning ()
 
void join ()
 
void run (void *classptr)
 
 ThreadWrapperBase (const std::string &thread_name="")
 
virtual ~ThreadWrapperBase ()
 

Public Attributes

bool m_threadShouldRun
 

Private Member Functions

void thread_entry ()
 

Additional Inherited Members

- Protected Attributes inherited from ThreadWrapperBase
std::string m_thread_name
 
void * pthis
 

Detailed Description

template<typename T, void(T::*)(bool &, UINT16 &) M>
class SickThread< T, M >

Wrapper class for posix threads.

Usage: Using object must create an instance of this class, and then call start() with its callback function as argument (see start() for more details). To stop the thread execution, call stop().

Setting the parameter m_beVerbose to true (e.g. via enableVerboseDebugOutput in function start()) will turn on very verbose output that should be useful for debugging.

The thread callback function itself has 2 parameters:

endThisThread: A bool flag that may be set by the callback function to "false" in case the thread function decides this thread needs to end.

sleepTimeMs: The sleep time, in ms, that will be spent between subsequent calls to the callback function. Default is 10 ms, but other times may be set. Note that not all operating systems may be able to schedule very short sleep times.

Definition at line 90 of file SickThread.hpp.

Constructor & Destructor Documentation

◆ SickThread()

template<typename T , void(T::*)(bool &, UINT16 &) M>
SickThread< T, M >::SickThread ( const std::string &  thread_name = "")
inline

Definition at line 118 of file SickThread.hpp.

◆ ~SickThread()

template<typename T , void(T::*)(bool &, UINT16 &) M>
virtual SickThread< T, M >::~SickThread ( )
inlinevirtual

Definition at line 119 of file SickThread.hpp.

Member Function Documentation

◆ join()

template<typename T , void(T::*)(bool &, UINT16 &) M>
void SickThread< T, M >::join ( )
inline

Definition at line 112 of file SickThread.hpp.

◆ thread_entry()

template<typename T , void(T::*)(bool &, UINT16 &) M>
void SickThread< T, M >::thread_entry ( )
inlineprivatevirtual

Implements ThreadWrapperBase.

Definition at line 92 of file SickThread.hpp.

Member Data Documentation

◆ m_threadShouldRun

template<typename T , void(T::*)(bool &, UINT16 &) M>
bool SickThread< T, M >::m_threadShouldRun

Definition at line 119 of file SickThread.hpp.


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


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:14