equal
deleted
inserted
replaced
30 * - It uses a slightly non-standard while loop for top-down heapify |
30 * - It uses a slightly non-standard while loop for top-down heapify |
31 * to move one if statement out of the loop. |
31 * to move one if statement out of the loop. |
32 */ |
32 */ |
33 |
33 |
34 #include "scheduler-heap.h" |
34 #include "scheduler-heap.h" |
35 #include "scheduler-factory.h" |
|
36 #include "event-impl.h" |
35 #include "event-impl.h" |
37 #include "ns3/assert.h" |
36 #include "ns3/assert.h" |
38 |
37 |
39 #include <string> |
38 #include <string> |
40 #define noTRACE_HEAP 1 |
39 #define noTRACE_HEAP 1 |
49 |
48 |
50 |
49 |
51 |
50 |
52 |
51 |
53 namespace ns3 { |
52 namespace ns3 { |
54 |
|
55 static class SchedulerHeapFactory : public SchedulerFactory |
|
56 { |
|
57 public: |
|
58 SchedulerHeapFactory () |
|
59 { |
|
60 SchedulerFactory::Add (this, "BinaryHeap"); |
|
61 } |
|
62 private: |
|
63 virtual Scheduler *DoCreate (void) const |
|
64 { |
|
65 return new SchedulerHeap (); |
|
66 } |
|
67 } g_schedulerHeapFactory; |
|
68 |
53 |
69 |
54 |
70 SchedulerHeap::SchedulerHeap () |
55 SchedulerHeap::SchedulerHeap () |
71 { |
56 { |
72 // we purposedly waste an item at the start of |
57 // we purposedly waste an item at the start of |