Debian Codegraph @

Source/Scheduler/CTaskSchedulerCommunicator.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_CTASKSCHEDULERCOMMUNICATOR_H
22 #define KONCLUDE_SCHEDULER_CTASKSCHEDULERCOMMUNICATOR_H
23
24 // Library includes
25
26
27 // Namespace includes
28 #include "SchedulerSettings.h"
29 #include "CTaskEventHandlerBasedScheduler.h"
30 #include "CTaskEventHandlerBasedProcessor.h"
31 #include "CTaskEventCommunicator.h"
32
33
34 // Other includes
35
36
37
38 // Logger includes
39 #include "Logger/CLogger.h"
40
41
42 namespace Konclude {
43
44 namespace Scheduler {
45
46
47 /*!
48 *
49 * \class CTaskSchedulerCommunicator
50 * \author Andreas Steigmiller
51 * \version 0.1
52 * \brief TODO
53 *
54 */
55 class CTaskSchedulerCommunicator {
56 // public methods
57 public:
58 //! Constructor
59 CTaskSchedulerCommunicator(CTaskEventHandlerBasedScheduler* taskScheduler, CTaskEventHandlerBasedProcessor* taskProcessor);
60
61 //! Destructor
62 virtual ~CTaskSchedulerCommunicator();
63
64
65 // calls to task scheduler
66 CTaskSchedulerCommunicator* communicateResponseScheduleTask(CTaskScheduleItem* taskScheduleItem, CTask* task, bool schedulingTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager);
67 CTaskSchedulerCommunicator* communicateRequestProcessTask(CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager);
68 CTaskSchedulerCommunicator* communicateCriticalScheduleTask(CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager);
69 CTaskSchedulerCommunicator* communicateTaskDispenseNotification(CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager);
70 CTaskSchedulerCommunicator* communicateScheduleUpdateTaskStatus(CTask* parentTask, CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager);
71
72 bool requiresTaskDispenseNotification(cint64 &dispenseNotificationTag);
73
74
75
76
77 // calls to task processor
78 CTaskSchedulerCommunicator* communicateProcessTask(CTask* task, bool schedulingTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager);
79 CTaskSchedulerCommunicator* communicateRequestScheduleTask(CTaskScheduleItem* taskScheduleItem, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager);
80 CTaskSchedulerCommunicator* communicateUpdateTaskStatus(CTask* parentTask, CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager);
81
82 bool canDispenseProcessingTasks();
83 bool requiresProcessingTasks();
84 cint64 countDispensableProcessingTasks();
85 cint64 countScheduleableProcessingTasks();
86 bool requiresSchedulingTasks();
87 bool hasTaskOwner(CTaskOwner* taskOwner);
88
89 cint64 getRecievedTasks();
90
91
92 // protected methods
93 protected:
94
95 // protected variables
96 protected:
97 CTaskEventCommunicator mSchedulerTaskEventCommunicator;
98 CTaskEventCommunicator mProcessorTaskEventCommunicator;
99 CTaskEventHandlerBasedScheduler* mTaskScheduler;
100 CTaskEventHandlerBasedProcessor* mTaskProcessor;
101
102 // private methods
103 private:
104
105 // private variables
106 private:
107 };
108
109
110 }; // end namespace Scheduler
111
112 }; // end namespace Konclude
113
114 #endif // KONCLUDE_SCHEDULER_CTASKSCHEDULERCOMMUNICATOR_H