AsyncWorker implements a async worker thread.
More...
#include <AsyncWorker.h>
AsyncWorker implements a async worker thread.
Definition at line 19 of file AsyncWorker.h.
◆ ~AsyncWorker()
AsyncWorker::~AsyncWorker |
( |
| ) |
|
|
virtual |
◆ isReady()
bool AsyncWorker::isReady |
( |
| ) |
|
if returns true, results are valid to be retrieved
Definition at line 36 of file AsyncWorker.cpp.
◆ run()
void AsyncWorker::run |
( |
| ) |
|
|
protectedvirtual |
Definition at line 52 of file AsyncWorker.cpp.
59 using namespace std::chrono_literals;
60 std::this_thread::sleep_for(100ms);
61 Utils::log(
"AsyncWorker",
"run til %d: %i", n, i);
void log(const char *tag, const char *format,...)
logs a formatted string platform independently
◆ setReady()
void AsyncWorker::setReady |
( |
| ) |
|
|
protected |
◆ start()
void AsyncWorker::start |
( |
| ) |
|
◆ stop()
void AsyncWorker::stop |
( |
| ) |
|
◆ stopRequested()
bool AsyncWorker::stopRequested |
( |
| ) |
|
|
protected |
◆ _ready
std::atomic_bool AsyncWorker::_ready {false} |
|
private |
◆ _stop
std::atomic_bool AsyncWorker::_stop {false} |
|
private |
◆ _thread
std::thread AsyncWorker::_thread |
|
private |
The documentation for this class was generated from the following files: