SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
z
Functions
a
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
w
z
Variables
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
c
d
e
f
h
i
k
l
m
n
r
s
t
Properties
Related Functions
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Functions
b
c
e
f
g
i
j
m
o
p
r
s
t
u
v
w
y
Variables
a
b
c
d
e
f
g
h
i
l
m
n
p
r
s
t
v
w
Typedefs
a
c
h
j
o
s
t
Enumerations
a
c
d
e
h
s
t
w
Enumerator
a
b
c
d
e
f
h
i
k
l
m
n
p
r
s
t
u
v
Macros
a
b
e
f
g
i
l
m
o
p
s
t
u
w
AsyncWorker.h
Go to the documentation of this file.
1
/**
2
* \file AsyncWorker.h
3
* \brief Declaration of an async worker thread class
4
* \date May 2024
5
* \authors Marino von Wattenwyl
6
* \copyright http://opensource.org/licenses/GPL-3.0
7
* \remarks Please use clangformat to format the code. See more code style on
8
* https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
9
*/
10
11
#ifndef ASYNC_WORKER_H
12
#define ASYNC_WORKER_H
13
14
#include <thread>
15
#include <atomic>
16
17
//-----------------------------------------------------------------------------
18
//! AsyncWorker implements a async worker thread
19
class
AsyncWorker
20
{
21
public
:
22
virtual
~AsyncWorker
();
23
24
void
start
();
25
void
stop
();
26
bool
isReady
();
27
28
protected
:
29
bool
stopRequested
();
30
void
setReady
();
31
virtual
void
run
();
32
33
private
:
34
std::thread
_thread
;
35
std::atomic_bool
_stop
{
false
};
36
std::atomic_bool
_ready
{
false
};
37
};
38
//-----------------------------------------------------------------------------
39
40
#endif
AsyncWorker
AsyncWorker implements a async worker thread.
Definition:
AsyncWorker.h:20
AsyncWorker::isReady
bool isReady()
if returns true, results are valid to be retrieved
Definition:
AsyncWorker.cpp:36
AsyncWorker::_thread
std::thread _thread
Definition:
AsyncWorker.h:34
AsyncWorker::_ready
std::atomic_bool _ready
Definition:
AsyncWorker.h:36
AsyncWorker::setReady
void setReady()
Definition:
AsyncWorker.cpp:47
AsyncWorker::run
virtual void run()
Definition:
AsyncWorker.cpp:52
AsyncWorker::_stop
std::atomic_bool _stop
Definition:
AsyncWorker.h:35
AsyncWorker::start
void start()
Definition:
AsyncWorker.cpp:20
AsyncWorker::stop
void stop()
Definition:
AsyncWorker.cpp:26
AsyncWorker::stopRequested
bool stopRequested()
Definition:
AsyncWorker.cpp:41
AsyncWorker::~AsyncWorker
virtual ~AsyncWorker()
Definition:
AsyncWorker.cpp:15
modules
utils
source
AsyncWorker.h
Generated by
1.9.1