MeVisLab Toolbox Reference
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace 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
l
m
n
o
p
r
s
t
u
v
Variables
_
a
b
c
d
e
f
h
i
l
m
n
o
p
s
v
w
Typedefs
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
v
w
z
Enumerations
a
b
c
d
e
f
l
m
n
o
p
r
s
t
v
w
Enumerator
a
b
c
d
e
f
g
i
j
l
m
n
o
p
r
s
t
u
v
w
x
y
z
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
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
c
d
e
f
g
h
i
k
m
n
o
p
r
s
t
v
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
_
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
Properties
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Related Functions
:
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
v
w
Files
File List
File 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
c
f
g
h
i
m
o
p
r
s
Variables
_
c
i
k
m
p
r
s
v
w
Typedefs
c
d
e
f
g
h
i
m
p
s
t
u
v
Enumerations
a
b
c
d
e
f
h
k
l
m
n
p
r
s
t
v
Enumerator
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
Macros
_
a
c
d
e
g
i
l
m
n
o
p
r
s
t
u
v
w
x
mlMainExecutor.h
Go to the documentation of this file.
1
/*************************************************************************************
2
**
3
** Copyright 2021, MeVis Medical Solutions AG
4
**
5
** The user may use this file in accordance with the license agreement provided with
6
** the Software or, alternatively, in accordance with the terms contained in a
7
** written agreement between the user and MeVis Medical Solutions AG.
8
**
9
** For further information use the contact form at https://www.mevislab.de/contact
10
**
11
**************************************************************************************/
12
13
#pragma once
14
15
#include "
mlBackgroundTaskManager.h
"
16
#include "
mlBackgroundTaskMessage.h
"
17
18
#include <
mlTypeDefs.h
>
19
#include <stlab/concurrency/task.hpp>
20
21
ML_START_NAMESPACE
22
23
//-----------------------------------------------------------------------
27
class
MainExecutorT
28
{
29
using
result_type = void;
30
31
class
MainExecutorMessage final :
public
BackgroundTaskMessage
32
{
33
stlab::task<void()> _f;
34
35
public
:
36
template
<
typename
F>
37
void
setTask(
F
&& f)
38
{
39
_f = std::forward<F>(f);
40
}
41
42
void
execute()
override
43
{
44
_f();
45
}
46
};
47
48
public
:
49
52
template
<
typename
F>
53
void
operator()
(
F
f)
const
54
{
55
auto
message = std::make_unique<MainExecutorMessage>();
56
message->setTask(std::move(f));
57
BackgroundTaskManager::self().sendMessageToGUI(message.release());
58
}
59
};
60
66
constexpr
auto
MainExecutor
=
MainExecutorT
{};
67
68
ML_END_NAMESPACE
F
@ F
Definition:
SoKeyGrabber.h:57
ml::BackgroundTaskMessage
The base class of all background messages.
Definition:
mlBackgroundTaskMessage.h:39
ml::MainExecutorT
This class implements an executor that allows you to execute a task in the ML's main loop without imp...
Definition:
mlMainExecutor.h:28
ml::MainExecutorT::operator()
void operator()(F f) const
Submit an function object of type 'void()' that should be executed within the ML's main loop.
Definition:
mlMainExecutor.h:53
mlBackgroundTaskManager.h
mlBackgroundTaskMessage.h
mlTypeDefs.h
ml::MainExecutor
constexpr auto MainExecutor
The only necessary instance of this main executor.
Definition:
mlMainExecutor.h:66
MeVis
Foundation
Sources
MLBackgroundTasks
mlMainExecutor.h
Generated by
1.9.1