Debian Codegraph @

Source/Scheduler/CTaskProcessorThread.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_SCHEDULER_CTASKPROCESSORTHREAD_H
22 #define KONCLUDE_SCHEDULER_CTASKPROCESSORTHREAD_H
23
24 // Libraries includes
25 #include <QMutex>
26
27 // Namespace includes
28 #include "SchedulerSettings.h"
29 #include "CTaskProcessorThreadBase.h"
30 #include "CTaskHandleContext.h"
31 #include "CTaskHandleMemoryAllocationManager.h"
32 #include "CTaskHandleMemoryPoolAllocationManager.h"
33 #include "CTaskHandleLimitedReserveMemoryPoolAllocationManager.h"
34 #include "CTaskHandleAlgorithm.h"
35 #include "CTaskProcessorContextBase.h"
36 #include "CTaskDistributionCompletorCommunicator.h"
37 #include "CConcreteTaskScheduleItem.h"
38 #include "CEventDistributionMemoryPoolReleaser.h"
39 #include "CTaskReserveQueueConsumer.h"
40
41 // Other includes
42 #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h"
43 #include "Utilities/Memory/CConsiderateMemoryPoolProvider.h"
44
45 #include "Scheduler/Events/CTaskDispenseNotificationEvent.h"
46
47 // Logger includes
48 #include "Logger/CLogger.h"
49
50
51
52 namespace Konclude {
53
54 using namespace Utilities::Memory;
55
56 namespace Scheduler {
57
58 using namespace Events;
59
60
61 /*!
62 *
63 * \class CTaskProcessorThread
64 * \author Andreas Steigmiller
65 * \version 0.1
66 * \brief TODO
67 *
68 */
69 class CTaskProcessorThread : public CTaskProcessorThreadBase {
70 // public methods
71 public:
72 //! Constructor
73 CTaskProcessorThread(CTaskHandleAlgorithm* taskHandleAlgo, CTaskEventHandlerBasedDistributionCompletor* distributorCompletor, CConsiderateMemoryPoolProvider* memoryPoolProvider = nullptr);
74
75 //! Destructor
76 virtual ~CTaskProcessorThread();
77
78
79 virtual CTaskEventHandlerBasedProcessor* installScheduler(CTaskEventHandlerBasedScheduler* scheduler);
80
81 // protected methods
82 protected:
83 virtual CTaskProcessorThread* installSchedulerCommunicator(CTaskSchedulerCommunicator* schedulerCommunicator);
84
85 virtual bool processEvent(CEvent *event, CContext* handlerContext);
86
87 virtual bool processDispenseNotification();
88 virtual bool processRequestProcessTask();
89 virtual bool processCriticalScheduleTask();
90 virtual bool processCompleteTask(CTask* task);
91 virtual bool processAdditionalTaskAllocation(CTask* task, CMemoryPool* memoryPool);
92 virtual bool processResponseScheduleTask(CTask* task, CTaskScheduleItem* taskScheduleItem, bool schedulingTask);
93 virtual bool processUpdateTaskStatus(CTask* task);
94 virtual bool processUpdateTaskStatus(CTask* parentTask, CTask* updateTask);
95
96
97
98 // protected variables
99 protected:
100 CConsiderateMemoryPoolProvider* mMemoryPoolProvider;
101 CDistributionMemoryPoolReleaser* mMemoryPoolReleaser;
102
103
104 // processor variables
105 cint64 mDispenseNotificationTag;
106 CTaskSchedulerCommunicator* mSchedulerCommunicator;
107
108 CTaskDistributionCompletorCommunicator* mDistributorCompletorCommunicator;
109
110 // private methods
111 private:
112
113 // private variables
114 private:
115
116 };
117
118 }; // end namespace Scheduler
119
120 }; // end namespace Konclude
121
122 #endif // KONCLUDE_SCHEDULER_CTASKPROCESSORTHREAD_H