Valkka
0.17.0
OpenSource Video Management
include
testthread.h
Go to the documentation of this file.
1
#ifndef testthread_HEADER_GUARD
2
#define testthread_HEADER_GUARD
3
/*
4
* testthread.h :
5
*
6
* Copyright 2017, 2018 Valkka Security Ltd. and Sampsa Riikonen.
7
*
8
* Authors: Sampsa Riikonen <sampsa.riikonen@iki.fi>
9
*
10
* This file is part of the Valkka library.
11
*
12
* Valkka is free software: you can redistribute it and/or modify
13
* it under the terms of the GNU Affero General Public License as
14
* published by the Free Software Foundation, either version 3 of the
15
* License, or (at your option) any later version.
16
*
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU Affero General Public License for more details.
21
*
22
* You should have received a copy of the GNU Affero General Public License
23
* along with this program. If not, see <https://www.gnu.org/licenses/>
24
*
25
*/
26
36
#include "Python.h"
37
#include "
thread.h
"
38
39
40
enum class
TestSignal {
41
none
,
42
exit,
43
add
44
};
45
46
47
48
struct
TestSignalContext
{
49
TestSignal
signal
;
50
};
51
52
53
54
class
TestThread
:
public
Thread
{
// <pyapi>
55
56
public
:
// <pyapi>
57
TestThread
(
const
char
* name);
// <pyapi>
58
virtual
~
TestThread
();
// <pyapi>
59
60
protected
:
61
std::deque<TestSignalContext>
signal_fifo
;
62
63
protected
:
64
PyObject *pyfunc;
65
66
public
:
67
void
run();
68
void
preRun();
69
void
postRun();
70
71
protected
:
72
void
triggerCallback(
int
i);
73
void
sendSignal(
TestSignalContext
signal_ctx);
74
75
public
:
// <pyapi>
76
void
setCallback(PyObject* pobj);
// <pyapi>
77
void
stopCall();
// <pyapi>
78
void
addCall();
// <pyapi>
79
};
// <pyapi>
80
81
82
#endif
FrameClass::signal
signal to AVThread or OpenGLThread. Also custom signals to custom Threads
TestSignalContext
Definition:
testthread.h:48
none
undefined (initial value)
Definition:
usbthread.h:143
thread.h
Base class for multithreading.
TestThread::signal_fifo
std::deque< TestSignalContext > signal_fifo
Redefinition of signal fifo (Thread::signal_fifo becomes hidden)
Definition:
testthread.h:61
TestThread
Definition:
testthread.h:54
Thread
A class for multithreading with a signaling system.
Definition:
thread.h:90
Generated by
1.8.13