RecoSim  1.0
 All Classes Files Functions Variables Enumerations
task_priority_comparator.h
Go to the documentation of this file.
1 
23 #ifndef TASK_PRIORITY_COMPARATOR_H
24 #define TASK_PRIORITY_COMPARATOR_H
25 
26 #include "task_priority_comparator_interface.h"
27 
32 BEGIN_PRIORITY_COMPARATOR(EDF)
33 {
34  return (lhs.get_deadline_time() > rhs.get_deadline_time());
35 }
36 END_PRIORITY_COMPARATOR
37 
38 
43 BEGIN_PRIORITY_COMPARATOR(EDF_WithPriorityArbiter)
44 {
45  if(lhs.get_deadline_time() == rhs.get_deadline_time()) {
46  return (lhs.get_task_priority() > rhs.get_task_priority());
47  } else {
48  return (lhs.get_deadline_time() < rhs.get_deadline_time());
49  }
50 }
51 END_PRIORITY_COMPARATOR
52 
53 
58 BEGIN_PRIORITY_COMPARATOR(FIFO)
59 {
60  return false;
61 }
62 END_PRIORITY_COMPARATOR
63 
64 
65 #endif