librealtime
1.2
Extreamely easy to use realtime and policy thread
|
A real time thread. More...
#include <RealtimeThread.hpp>
Public Member Functions | |
double | getPeriodAsSecond () |
Get set period of this thread. More... | |
double | getFrequency () |
bool | isStarted () |
Check if thread is already start. More... | |
template<class F , class... Args> | |
RealtimeThread (double frequency, F &&func, Args &&... args) | |
A constructor of real time thread class. More... | |
void | start (bool shouldRealtime) |
This method allows to start thread loop. More... | |
void | join () |
Join the real time thread. More... | |
void | detach () |
Detach the real time thread. More... | |
bool | joinable () |
Check the thread can join or not. More... | |
A real time thread.
This class make a periodic thread. the thread's loop is invoked with strict frequency. This thread class allows you to use like std::thread.
|
inline |
A constructor of real time thread class.
frequency | Frequency of executing task of the thread [Hz]. |
func | Function to execute in thread loop. |
args | Arguments of func. You can set not only one argument but also multiple arguments. |
|
inline |
Detach the real time thread.
Just std::thread::detach() is called in detach() in this function.
|
inline |
Get set period of this thread.
|
inline |
Check if thread is already start.
If already started, return true. Othrewise return false.
|
inline |
Join the real time thread.
Just std::thread::join() will be called inside RealtimeThread::join().
|
inline |
Check the thread can join or not.
|
inline |
This method allows to start thread loop.
shouldRealtime | If true, this thread works as real time thread. otherwize false is set, this thread works as periodic std::thread. |
Starting your thread with DEADLINE policy which is a real time thread controlling method.