Debian Codegraph @

Source/Concurrent/CEventThread.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_CEVENTTHREAD_H
22 #define KONCLUDE_CONCURRENT_CEVENTTHREAD_H
23
24 // Library includes
25
26
27 // Namespace includes
28 #include "ConcurrentSettings.h"
29 #include "CThread.h"
30 #include "CEventHandler.h"
31 #include "CQueuedLinkedEventHandler.h"
32 #include "CThreadActivator.h"
33 #include "CEventProcessor.h"
34
35 // Other includes
36 #include "Concurrent/Events/CHandleEventsEvent.h"
37
38 #include "Utilities/Container/CLinker.h"
39
40 // Logger includes
41 #include "Logger/CLogger.h"
42
43
44 namespace Konclude {
45
46 using namespace Utilities::Container;
47
48 namespace Concurrent {
49
50 using namespace Events;
51
52
53 /*!
54 *
55 * \class CEventThread
56 * \author Andreas Steigmiller
57 * \version 0.1
58 * \brief TODO
59 *
60 */
61 class CEventThread : public CThread, public CThreadActivator {
62 // public methods
63 public:
64 //! Constructor
65 CEventThread();
66
67 //! Destructor
68 virtual ~CEventThread();
69
70 virtual CEventHandler* createInstalledEventHandler(CEventProcessor* eventProcessor);
71
72 virtual CThreadActivator* signalizeEvent();
73
74 // protected methods
75 protected:
76 virtual bool processControlEvents(QEvent::Type type, CControlEvent *event);
77
78 virtual bool handleEvents(double minEventPriority = 0., cint64 maxHandleEventCount = -1);
79
80 // protected variables
81 protected:
82 QMutex mAddEventHandlerSyncMutex;
83 CXLinker<CEventHandler*>* mEventHandlerLinker;
84 CContext* threadContext;
85
86 bool mHandleEventStopped;
87 cint64 mHandleEventsCountPerStep;
88
89 bool mEventSignalized;
90 bool mEventProcessingStopped;
91 cint64 mLastProcessingStartRequestTag;
92 cint64 mLastProcessingStartedTag;
93
94 // private methods
95 private:
96
97 // private variables
98 private:
99 };
100
101
102 }; // end namespace Concurrent
103
104 }; // end namespace Konclude
105
106 #endif // KONCLUDE_CONCURRENT_CEVENTTHREAD_H