VectorNav C++ Library
Public Types | Public Member Functions | Static Public Member Functions | List of all members
vn::xplat::Thread Class Reference

Represents a cross-platform thread. More...

#include <thread.h>

Inheritance diagram for vn::xplat::Thread:
vn::util::NoCopy

Public Types

typedef void(* ThreadStartRoutine) (void *)
 Represents a start routine for a thread which will have data passed to it.
 

Public Member Functions

void start (void *routineData)
 Starts the thread. More...
 
void join ()
 Blocks the calling thread until this thread finishes.
 

Static Public Member Functions

static ThreadstartNew (ThreadStartRoutine startRoutine, void *routineData)
 Starts a new thread immediately which calls the provided start routine and passes the routine data to the new thread. More...
 
static void sleepSec (uint32_t numOfSecsToSleep)
 Causes the thread to sleep the specified number of seconds. More...
 
static void sleepMs (uint32_t numOfMsToSleep)
 Causes the thread to sleep the specified number of milliseconds. More...
 
static void sleepUs (uint32_t numOfUsToSleep)
 Causes the thread to sleep the specified number of microseconds. More...
 
static void sleepNs (uint32_t numOfNsToSleep)
 Causes the thread to sleep the specified number of nanoseconds. More...
 

Detailed Description

Represents a cross-platform thread.

Member Function Documentation

static void vn::xplat::Thread::sleepMs ( uint32_t  numOfMsToSleep)
static

Causes the thread to sleep the specified number of milliseconds.

Parameters
[in]numOfMsToSleepThe number of milliseconds to sleep.
static void vn::xplat::Thread::sleepNs ( uint32_t  numOfNsToSleep)
static

Causes the thread to sleep the specified number of nanoseconds.

Parameters
[in]numOfNsToSleepThe number of nanoseconds to sleep.
static void vn::xplat::Thread::sleepSec ( uint32_t  numOfSecsToSleep)
static

Causes the thread to sleep the specified number of seconds.

Parameters
[in]numOfSecsToSleepThe number of seconds to sleep.
static void vn::xplat::Thread::sleepUs ( uint32_t  numOfUsToSleep)
static

Causes the thread to sleep the specified number of microseconds.

Parameters
[in]numOfUsToSleepThe number of microseconds to sleep.
void vn::xplat::Thread::start ( void *  routineData)

Starts the thread.

Parameters
[in]routineDataPointer to the routine data which the new thread have access to.
static Thread* vn::xplat::Thread::startNew ( ThreadStartRoutine  startRoutine,
void *  routineData 
)
static

Starts a new thread immediately which calls the provided start routine and passes the routine data to the new thread.

Parameters
[in]startRoutineThe routine to be called when the new thread is started.
[in]routineDataPointer to data that will be passed to the new thread via its start routine.
Returns
A Thread object representing the newly started thread. User must delete the returned pointer when finished.

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