Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
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
k
l
m
n
o
p
q
r
s
t
u
v
z
+
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
x
y
+
Typedefs
a
b
c
d
f
h
i
n
o
p
q
r
s
t
u
+
Enumerations
a
c
d
e
f
i
m
n
p
q
r
s
t
u
+
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
z
+
Classes
Class List
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
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Enumerations
a
b
c
d
e
f
g
i
l
m
n
p
r
s
t
u
w
+
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
+
Related Functions
c
e
h
i
m
o
p
q
s
t
v
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
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
q
r
s
t
u
v
x
z
+
Variables
a
b
c
e
g
i
l
m
n
p
r
s
t
v
x
y
+
Typedefs
a
b
c
d
e
f
h
i
l
m
n
p
q
r
s
t
u
Enumerator
+
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
src
extern
eigen3
unsupported
Eigen
CXX11
src
ThreadPool
ThreadEnvironment.h
Go to the documentation of this file.
1
// This file is part of Eigen, a lightweight C++ template library
2
// for linear algebra.
3
//
4
// Copyright (C) 2014 Benoit Steiner <benoit.steiner.goog@gmail.com>
5
//
6
// This Source Code Form is subject to the terms of the Mozilla
7
// Public License v. 2.0. If a copy of the MPL was not distributed
8
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
10
#ifndef EIGEN_CXX11_THREADPOOL_THREAD_ENVIRONMENT_H
11
#define EIGEN_CXX11_THREADPOOL_THREAD_ENVIRONMENT_H
12
13
namespace
Eigen
{
14
15
struct
StlThreadEnvironment
{
16
struct
Task
{
17
std::function<void()>
f
;
18
};
19
20
// EnvThread constructor must start the thread,
21
// destructor must join the thread.
22
class
EnvThread
{
23
public
:
24
EnvThread
(std::function<
void
()>
f
) : thr_(
std
::move(
f
)) {}
25
~EnvThread
() { thr_.join(); }
26
27
private
:
28
std::thread
thr_
;
29
};
30
31
EnvThread
*
CreateThread
(std::function<
void
()>
f
) {
return
new
EnvThread
(std::move(
f
)); }
32
Task
CreateTask
(std::function<
void
()>
f
) {
return
Task
{std::move(
f
)}; }
33
void
ExecuteTask
(
const
Task
& t) { t.
f
(); }
34
};
35
36
}
// namespace Eigen
37
38
#endif // EIGEN_CXX11_THREADPOOL_THREAD_ENVIRONMENT_H
Eigen::StlThreadEnvironment::EnvThread::~EnvThread
~EnvThread()
Definition:
ThreadEnvironment.h:25
Eigen::StlThreadEnvironment::CreateThread
EnvThread * CreateThread(std::function< void()> f)
Definition:
ThreadEnvironment.h:31
Eigen
Definition:
common.h:73
std
Definition:
Half.h:150
Eigen::StlThreadEnvironment
Definition:
ThreadEnvironment.h:15
Eigen::StlThreadEnvironment::CreateTask
Task CreateTask(std::function< void()> f)
Definition:
ThreadEnvironment.h:32
Eigen::StlThreadEnvironment::Task
Definition:
ThreadEnvironment.h:16
Eigen::StlThreadEnvironment::EnvThread::thr_
std::thread thr_
Definition:
ThreadEnvironment.h:28
Eigen::StlThreadEnvironment::ExecuteTask
void ExecuteTask(const Task &t)
Definition:
ThreadEnvironment.h:33
Eigen::StlThreadEnvironment::EnvThread
Definition:
ThreadEnvironment.h:22
Eigen::StlThreadEnvironment::EnvThread::EnvThread
EnvThread(std::function< void()> f)
Definition:
ThreadEnvironment.h:24
Eigen::StlThreadEnvironment::Task::f
std::function< void()> f
Definition:
ThreadEnvironment.h:17
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Mon Feb 28 2022 22:07:52