Debian Codegraph @

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