Revision 5668c48e

View differences:

include/cmessage.h
231 231
    /**
232 232
     * INTERNAL: used by cTaskHeap
233 233
     */
234
    inline unsigned long taskInsertOrder() const  {return taskinsertordr;}
234
    inline unsigned long getTaskInsertOrder() const  {return taskinsertordr;}
235 235

  
236 236
    /**
237 237
     * INTERNAL:
src/sim/ctaskheap.cc
39 39

  
40 40
//==========================================================================
41 41

  
42
static inline int operator <= (cMessage& a, cMessage& b)
42
/*
43
static inline bool operator > (cMessage& a, cMessage& b)
43 44
{
44
  return (a.getTend() < b.getTend()) ? 1 :
45
         (a.getTend() > b.getTend()) ? 0 :
46
          a.taskInsertOrder() <= b.taskInsertOrder();
45
  return (a.getTend() > b.getTend()) ? 1 :
46
         (a.getTend() < b.getTend()) ? 0 :
47
          a.getTaskInsertOrder() > b.getTaskInsertOrder();
47 48
}
49
*/
48 50

  
49
static inline int operator > (cMessage& a, cMessage& b)
51
static inline bool operator > (cMessage& a, cMessage& b)
50 52
{
51
    return !(a<=b);
53
    return a.getTend() > b.getTend() ? true :                                       // 1. criterion: starting time
54
           a.getTend() < b.getTend() ? false :
55
           a.getSchedulingPriority() > b.getSchedulingPriority() ? true :           // 2. criterion: priority
56
           a.getSchedulingPriority() < b.getSchedulingPriority() ? false :
57
           a.getParentStartTime() > b.getParentStartTime() ? true :                 // 3. criterion: parent starting time
58
           a.getParentStartTime() < b.getParentStartTime() ? false :
59
           a.getParentExecutionOrderId() > b.getParentExecutionOrderId() ? true :   // 4. criterion: parent execution order
60
           a.getParentExecutionOrderId() < b.getParentExecutionOrderId() ? false :
61
           a.getSchedulingOrderId() > b.getSchedulingOrderId() ? true :             // 5. criterion: scheduling order
62
           a.getSchedulingOrderId() < b.getSchedulingOrderId() ? false :
63
           a.getTaskInsertOrder() > b.getTaskInsertOrder();                         // 6. criterion: final tie breaker (needed during init)
52 64
}
53 65

  
66
static inline bool operator <= (cMessage& a, cMessage& b)
67
{
68
    return !(a>b);
69
}
54 70

  
55 71
static int qsort_cmp_msgs(const void *p1, const void *p2)
56 72
{
......
61 77
    if (dt<0)       return -1;
62 78
    else if (dt>0)  return 1;
63 79

  
64
    return (m1->taskInsertOrder() < m2->taskInsertOrder()) ? -1 : 1;
80
    return (m1->getTaskInsertOrder() < m2->getTaskInsertOrder()) ? -1 : 1;
65 81
}
66 82

  
67 83

  

Also available in: Unified diff