LEFT | RIGHT |
(no file at all) | |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2009 INRIA | 3 * Copyright (c) 2009 INRIA |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 * Resize to a new number of buckets, with automatically computed width. | 83 * Resize to a new number of buckets, with automatically computed width. |
84 * | 84 * |
85 * \param [in] newSize The new number of buckets. | 85 * \param [in] newSize The new number of buckets. |
86 */ | 86 */ |
87 void Resize (uint32_t newSize); | 87 void Resize (uint32_t newSize); |
88 /** | 88 /** |
89 * Compute the new bucket size, based on up to the first 25 entries. | 89 * Compute the new bucket size, based on up to the first 25 entries. |
90 * | 90 * |
91 * \returns The new width. | 91 * \returns The new width. |
92 */ | 92 */ |
93 uint32_t CalculateNewWidth (void); | 93 uint64_t CalculateNewWidth (void); |
94 /** | 94 /** |
95 * Initialize the calendar queue. | 95 * Initialize the calendar queue. |
96 * | 96 * |
97 * \param [in] nBuckets The number of buckets. | 97 * \param [in] nBuckets The number of buckets. |
98 * \param [in] width The bucket size, in dimensionless time units. | 98 * \param [in] width The bucket size, in dimensionless time units. |
99 * \param [in] startPrio The starting time. | 99 * \param [in] startPrio The starting time. |
100 */ | 100 */ |
101 void Init (uint32_t nBuckets, | 101 void Init (uint32_t nBuckets, |
102 uint64_t width, | 102 uint64_t width, |
103 uint64_t startPrio); | 103 uint64_t startPrio); |
104 /** | 104 /** |
105 * Hash the dimensionless time to a bucket. | 105 * Hash the dimensionless time to a bucket. |
106 * | 106 * |
107 * \param [in] key The dimensionless time. | 107 * \param [in] key The dimensionless time. |
108 * \returns The bucket index. | 108 * \returns The bucket index. |
109 */ | 109 */ |
110 inline uint32_t Hash (uint64_t key) const; | 110 inline uint32_t Hash (uint64_t key) const; |
111 /** Print the configuration and bucket size distribution. */ | 111 /** Print the configuration and bucket size distribution. */ |
112 void PrintInfo (void); | 112 void PrintInfo (void); |
113 /** | 113 /** |
114 * Resize the number of buckets and width. | 114 * Resize the number of buckets and width. |
115 * | 115 * |
116 * \param [in] newSize The number of buckets. | 116 * \param [in] newSize The number of buckets. |
117 * \param [in] newWidth The size of the new buckets. | 117 * \param [in] newWidth The size of the new buckets. |
118 */ | 118 */ |
119 void DoResize (uint32_t newSize, uint32_t newWidth); | 119 void DoResize (uint32_t newSize, uint64_t newWidth); |
120 /** | 120 /** |
121 * Remove the earliest event. | 121 * Remove the earliest event. |
122 * | 122 * |
123 * \returns The earliest event. | 123 * \returns The earliest event. |
124 */ | 124 */ |
125 Scheduler::Event DoRemoveNext (void); | 125 Scheduler::Event DoRemoveNext (void); |
126 /** | 126 /** |
127 * Insert a new event in to the correct bucket. | 127 * Insert a new event in to the correct bucket. |
128 * | 128 * |
129 * \param [in] ev The new Event. | 129 * \param [in] ev The new Event. |
(...skipping 15 matching lines...) Expand all Loading... |
145 uint64_t m_bucketTop; | 145 uint64_t m_bucketTop; |
146 /** The priority of the last event removed. */ | 146 /** The priority of the last event removed. */ |
147 uint64_t m_lastPrio; | 147 uint64_t m_lastPrio; |
148 /** Number of events in queue. */ | 148 /** Number of events in queue. */ |
149 uint32_t m_qSize; | 149 uint32_t m_qSize; |
150 }; | 150 }; |
151 | 151 |
152 } // namespace ns3 | 152 } // namespace ns3 |
153 | 153 |
154 #endif /* CALENDAR_SCHEDULER_H */ | 154 #endif /* CALENDAR_SCHEDULER_H */ |
LEFT | RIGHT |