Scheduler
priorityDiscipline.h
Go to the documentation of this file.
1 
10 #ifndef PRIORITYDISCIPLINE_H
11 #define PRIORITYDISCIPLINE_H
12 
13 #include "schedulingDiscipline.h"
14 #include <memory>
15 
16 namespace Scheduler
17 {
18 
20 {
21 public:
22  PriorityDiscipline(std::shared_ptr<SchedulerConfiguration> c) : SchedulingDiscipline(c){};//TODO: do we need a constructor if it's pure virtual?
23  virtual ~PriorityDiscipline(){};
24 
25  typedef bool (*ComparatorPointer)(std::shared_ptr<Process> , std::shared_ptr<Process> );
26 
27  std::shared_ptr<Process> selectNextTask(Queue *readyQueue, std::shared_ptr<Process> running, unsigned int);
28  virtual bool preempts(TriggeringEvent trigger);
29  virtual std::string getName()=0;
30 protected:
33  virtual void updatePriorities(Queue *readyQueue, std::shared_ptr<Process> running);
39 };
40 
41 }
42 
43 #endif
TriggeringEvent
Definition: eventType.h:16
PriorityDiscipline(std::shared_ptr< SchedulerConfiguration > c)
This class implements the ready queue and the wait queue. Those queues contain processes ready to run...
Definition: queue.h:28
std::shared_ptr< Process > selectNextTask(Queue *readyQueue, std::shared_ptr< Process > running, unsigned int)
select the best task to run at this point.
virtual ComparatorPointer getComparator()
return a function pointer to a function that provides comparison of tasks&#39; priorities ...
virtual void updatePriorities(Queue *readyQueue, std::shared_ptr< Process > running)
sets the correct priorities to the tasks, especially if dynamic priorities are used.
virtual std::string getName()=0
returns the name of that discipline
virtual bool preempts(TriggeringEvent trigger)
returns true if the argument is a scheduling trigger for this specific discipline ...
bool(* ComparatorPointer)(std::shared_ptr< Process >, std::shared_ptr< Process >)