A real time thread.
More...
#include <PolicyThread.hpp>
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.
◆ PolicyThread()
template<class F , class... Args>
PolicyThread::PolicyThread |
( |
F && |
func, |
|
|
Args &&... |
args |
|
) |
| |
|
inline |
A constructor of real time thread class.
- Parameters
-
frequency | Frequency of executing task of the thread. |
func | Function to execute in thread loop. |
args | Arguments of func. You can set not only one argument but also multiple arguments. |
◆ detach()
void PolicyThread::detach |
( |
| ) |
|
|
inline |
Detach the real time thread.
Just std::thread::detach() is called in this function.
◆ getPriority()
int PolicyThread::getPriority |
( |
| ) |
|
|
inline |
Get Priority from running thread.
- Returns
- A priority of the thread.
◆ isStarted()
bool PolicyThread::isStarted |
( |
| ) |
|
|
inline |
Check if thread is already start.
If already started, return true. Othrewise return false.
◆ join()
void PolicyThread::join |
( |
| ) |
|
|
inline |
Join the real time thread.
Only std::thread::join() will be called in this function.
◆ joinable()
bool PolicyThread::joinable |
( |
| ) |
|
|
inline |
Check the thread can join or not.
- Returns
- If the thread can join, return true. Otherwise false.
◆ start()
void PolicyThread::start |
( |
int |
priority = 0 | ) |
|
|
inline |
Start thread with the priority and FIFO policy.
- Parameters
-
priority | A priority. Set higher number, Get Higher priority. Default priority is 0. |
Starting your thread with FIFO policy with the priority.
- Maximum priority = 99
- Minimum priority = 0
The documentation for this class was generated from the following file: