Debian Codegraph @

Source/Concurrent/Callback/CBlockingCallbackData.h

raw
1 /*
2 * Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
3 *
4 * This file is part of the reasoning system Konclude.
5 * For details and support, see <http://konclude.com/>.
6 *
7 * Konclude is free software: you can redistribute it and/or modify
8 * it under the terms of version 3 of the GNU Lesser General Public
9 * License (LGPLv3) as published by the Free Software Foundation.
10 *
11 * Konclude is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU (Lesser) General Public License for more details.
15 *
16 * You should have received a copy of the GNU (Lesser) General Public
17 * License along with Konclude. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #ifndef KONCLUDE_CONCURRENT_CALLBACK_CBlockingCallbackData_H
22 #define KONCLUDE_CONCURRENT_CALLBACK_CBlockingCallbackData_H
23
24
25 #include <QSemaphore>
26
27 #include "CCallbackData.h"
28
29
30
31 namespace Konclude {
32
33 namespace Concurrent {
34
35 namespace Callback {
36
37
38 /*!
39 *
40 * \class CBlockingCallbackData
41 * \author Andreas Steigmiller
42 * \version 0.1
43 * \brief TODO
44 *
45 */
46 class CBlockingCallbackData : public CCallbackData {
47
48 public:
49 CBlockingCallbackData(int idNumber = 0);
50 virtual ~CBlockingCallbackData();
51
52 virtual void doCallback();
53
54 int getIdNumber();
55 int setIdNumber(int idNumber);
56
57 bool waitForCallback(int timeout = -1);
58
59 protected:
60 int id;
61 QSemaphore semaphore;
62
63
64 };
65
66 }; // end namespace Callback
67
68 }; // end namespace Concurrent
69
70 }; // end namespace Konclude
71
72 #endif // KONCLUDE_CONCURRENT_CALLBACK_CBlockingCallbackData_H