Main MRPT website > C++ reference for MRPT 1.5.9
Classes | Namespaces | Enumerations | Functions
threads.h File Reference
#include <mrpt/utils/core_defs.h>
#include <thread>
#include <memory>
Include dependency graph for threads.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mrpt::system::TThreadHandle
 A MRPT thread handle. More...
 

Namespaces

 mrpt
 This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
 
 mrpt::system
 This namespace provides a OS-independent interface to many useful functions: filenames manipulation, time and date, string parsing, file I/O, threading, memory allocation, etc.
 

Enumerations

enum  mrpt::system::TProcessPriority { mrpt::system::ppIdle = 0, mrpt::system::ppNormal, mrpt::system::ppHigh, mrpt::system::ppVeryHigh }
 The type for cross-platform process (application) priorities. More...
 
enum  mrpt::system::TThreadPriority {
  mrpt::system::tpLowests =-15, mrpt::system::tpLower = -2, mrpt::system::tpLow = -1, mrpt::system::tpNormal = 0,
  mrpt::system::tpHigh = 1, mrpt::system::tpHigher = 2, mrpt::system::tpHighest = 15
}
 The type for cross-platform thread priorities. More...
 

Functions

template<typename T >
TThreadHandle mrpt::system::createThread (void(*func)(T), T param)
 Creates a new thread from a function (or static method) with one generic parameter. More...
 
template<typename T >
TThreadHandle mrpt::system::createThreadRef (void(*func)(T &), T &param)
 
TThreadHandle mrpt::system::createThread (void(*func)(void))
 
template<typename CLASS , typename PARAM >
TThreadHandle mrpt::system::createThreadFromObjectMethod (CLASS *obj, void(CLASS::*func)(PARAM), PARAM param)
 Creates a new thread running a non-static method (so it will have access to "this") from another method of the same class - with one generic parameter. More...
 
template<typename CLASS , typename PARAM >
TThreadHandle mrpt::system::createThreadFromObjectMethodRef (CLASS *obj, void(CLASS::*func)(PARAM &), PARAM &param)
 
template<typename CLASS >
TThreadHandle mrpt::system::createThreadFromObjectMethod (CLASS *obj, void(CLASS::*func)(void))
 
void BASE_IMPEXP mrpt::system::joinThread (TThreadHandle &threadHandle)
 Waits until the given thread ends. More...
 
unsigned long BASE_IMPEXP mrpt::system::getCurrentThreadId () MRPT_NO_THROWS
 Returns the ID of the current thread. More...
 
void BASE_IMPEXP mrpt::system::exitThread () MRPT_NO_THROWS
 Explicit close of the current (running) thread. More...
 
void BASE_IMPEXP mrpt::system::getCurrentThreadTimes (time_t &creationTime, time_t &exitTime, double &cpuTime)
 Returns the creation and exit times of the current thread and its CPU time consumed. More...
 
void BASE_IMPEXP mrpt::system::changeCurrentThreadPriority (TThreadPriority priority)
 Change the priority of the current thread - for Windows, see also changeCurrentProcessPriority() More...
 
void BASE_IMPEXP mrpt::system::terminateThread (TThreadHandle &threadHandle) MRPT_NO_THROWS
 Terminate a thread, giving it no choice to delete objects, etc (use only as a last resource) More...
 
void BASE_IMPEXP mrpt::system::changeCurrentProcessPriority (TProcessPriority priority)
 Change the priority of the given process (it applies to all the threads, plus independent modifiers for each thread). More...
 
unsigned int BASE_IMPEXP mrpt::system::getNumberOfProcessors ()
 Return the number of processors ("cores"), or 1 if it cannot be determined. More...
 
void BASE_IMPEXP mrpt::system::sleep (int time_ms) MRPT_NO_THROWS
 An OS-independent method for sending the current thread to "sleep" for a given period of time. More...
 
bool BASE_IMPEXP mrpt::system::launchProcess (const std::string &command)
 Executes the given command (which may contain a program + arguments), and waits until it finishes. More...
 



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020