MRPT  1.9.9
rp::hal::Thread Class Reference

Detailed Description

Definition at line 41 of file thread.h.

#include <rplidar/src/hal/thread.h>

Public Types

enum  priority_val_t {
  PRIORITY_REALTIME = 0, PRIORITY_HIGH = 1, PRIORITY_NORMAL = 2, PRIORITY_LOW = 3,
  PRIORITY_IDLE = 4
}
 

Public Member Functions

 ~Thread ()=default
 
 Thread ()=default
 
_word_size_t getHandle ()
 
u_result terminate ()
 
voidgetData ()
 
u_result join (unsigned long timeout=-1)
 
u_result setPriority (priority_val_t p)
 
priority_val_t getPriority ()
 
bool operator== (const Thread &right)
 

Static Public Member Functions

template<class T , u_result(T::*)(void) PROC>
static Thread create_member (T *pthis)
 
template<class T , u_result(T::*)(void) PROC>
static _word_size_t THREAD_PROC _thread_thunk (void *data)
 
static Thread create (thread_proc_t proc, void *data=nullptr)
 

Protected Member Functions

 Thread (thread_proc_t proc, void *data)
 

Protected Attributes

void_data {nullptr}
 
thread_proc_t _func {nullptr}
 
_word_size_t _handle {0}
 

Member Enumeration Documentation

◆ priority_val_t

Enumerator
PRIORITY_REALTIME 
PRIORITY_HIGH 
PRIORITY_NORMAL 
PRIORITY_LOW 
PRIORITY_IDLE 

Definition at line 44 of file thread.h.

Constructor & Destructor Documentation

◆ ~Thread()

rp::hal::Thread::~Thread ( )
default

◆ Thread() [1/2]

rp::hal::Thread::Thread ( )
default

◆ Thread() [2/2]

rp::hal::Thread::Thread ( thread_proc_t  proc,
void data 
)
inlineprotected

Definition at line 82 of file thread.h.

Member Function Documentation

◆ _thread_thunk()

template<class T , u_result(T::*)(void) PROC>
static _word_size_t THREAD_PROC rp::hal::Thread::_thread_thunk ( void data)
inlinestatic

Definition at line 60 of file thread.h.

◆ create()

Thread rp::hal::Thread::create ( thread_proc_t  proc,
void data = nullptr 
)
static

Definition at line 41 of file linux/thread.hpp.

References _handle.

Referenced by create_member().

Here is the caller graph for this function:

◆ create_member()

template<class T , u_result(T::*)(void) PROC>
static Thread rp::hal::Thread::create_member ( T *  pthis)
inlinestatic

Definition at line 54 of file thread.h.

References create().

Here is the call graph for this function:

◆ getData()

void* rp::hal::Thread::getData ( )
inline

Definition at line 71 of file thread.h.

References _data.

◆ getHandle()

_word_size_t rp::hal::Thread::getHandle ( )
inline

Definition at line 69 of file thread.h.

References _handle.

Referenced by rp::standalone::rplidar::RPlidarDriverSerialImpl::startScanExpress(), and rp::standalone::rplidar::RPlidarDriverSerialImpl::startScanNormal().

Here is the caller graph for this function:

◆ getPriority()

Thread::priority_val_t rp::hal::Thread::getPriority ( )

Definition at line 103 of file linux/thread.hpp.

References _handle, PRIORITY_HIGH, PRIORITY_NORMAL, and PRIORITY_REALTIME.

◆ join()

u_result rp::hal::Thread::join ( unsigned long  timeout = -1)

Definition at line 129 of file linux/thread.hpp.

References _handle, and RESULT_OK.

Referenced by rp::standalone::rplidar::RPlidarDriverSerialImpl::_disableDataGrabbing().

Here is the caller graph for this function:

◆ operator==()

bool rp::hal::Thread::operator== ( const Thread right)
inline

Definition at line 76 of file thread.h.

References _handle.

◆ setPriority()

u_result rp::hal::Thread::setPriority ( priority_val_t  p)

◆ terminate()

u_result rp::hal::Thread::terminate ( )

Definition at line 53 of file linux/thread.hpp.

References _handle, RESULT_OK, and RESULT_OPERATION_FAIL.

Member Data Documentation

◆ _data

void* rp::hal::Thread::_data {nullptr}
protected

Definition at line 86 of file thread.h.

Referenced by getData().

◆ _func

thread_proc_t rp::hal::Thread::_func {nullptr}
protected

Definition at line 87 of file thread.h.

◆ _handle

_word_size_t rp::hal::Thread::_handle {0}
protected

Definition at line 88 of file thread.h.

Referenced by create(), getHandle(), getPriority(), join(), operator==(), setPriority(), and terminate().




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019