View | Details | Raw Unified | Return to bug 2621
Collapse All | Expand All

(-)a/src/wifi/model/edca-txop-n.cc (-2 / +2 lines)
 Lines 357-363   void EdcaTxopN::NotifyInternalCollision (void) Link Here 
357
        }
357
        }
358
      else
358
      else
359
        {
359
        {
360
          Ptr<const WifiMacQueueItem> item = m_queue->Peek ();
360
          Ptr<const WifiMacQueueItem> item = m_queue->PeekFront ();
361
          if (item)
361
          if (item)
362
            {
362
            {
363
              packet = item->GetPacket ();
363
              packet = item->GetPacket ();
 Lines 416-422   void EdcaTxopN::NotifyInternalCollision (void) Link Here 
416
          else
416
          else
417
            {
417
            {
418
              NS_LOG_DEBUG ("Dequeueing and discarding head of queue");
418
              NS_LOG_DEBUG ("Dequeueing and discarding head of queue");
419
              Ptr<const WifiMacQueueItem> item = m_queue->Peek ();
419
              Ptr<const WifiMacQueueItem> item = m_queue->PeekFront ();
420
              if (item)
420
              if (item)
421
                {
421
                {
422
                  packet = item->GetPacket ();
422
                  packet = item->GetPacket ();
(-)a/src/wifi/model/wifi-mac-queue.cc (-1 / +17 lines)
 Lines 273-280   template<> Link Here 
273
Ptr<const WifiMacQueueItem>
273
Ptr<const WifiMacQueueItem>
274
WifiMacQueue::Peek (void) const
274
WifiMacQueue::Peek (void) const
275
{
275
{
276
  NS_FATAL_ERROR ("Do not use the Peek method. Use the PeekFront method instead");
277
}
278
279
template<>
280
Ptr<const WifiMacQueueItem>
281
WifiMacQueue::PeekFront (void)
282
{
276
  NS_LOG_FUNCTION (this);
283
  NS_LOG_FUNCTION (this);
277
  return DoPeek (Head ());
284
285
  for (auto it = Head (); it != Tail (); )
286
    {
287
      if (!TtlExceeded (it))
288
        {
289
          return DoPeek (it);
290
        }
291
    }
292
  NS_LOG_DEBUG ("The queue is empty");
293
  return 0;
278
}
294
}
279
295
280
template<>
296
template<>
(-)a/src/wifi/model/wifi-mac-queue.h (-1 / +9 lines)
 Lines 226-237   public: Link Here 
226
   */
226
   */
227
  Ptr<Item> DequeueFirstAvailable (const QosBlockedDestinations *blockedPackets);
227
  Ptr<Item> DequeueFirstAvailable (const QosBlockedDestinations *blockedPackets);
228
  /**
228
  /**
229
   * Peek the packet in the front of the queue. The packet is not removed.
229
   * Do not use this method. To peek the packet in the front of the queue,
230
   * use the PeekFront method instead.
230
   *
231
   *
231
   * \return the packet
232
   * \return the packet
232
   */
233
   */
233
  Ptr<const Item> Peek (void) const;
234
  Ptr<const Item> Peek (void) const;
234
  /**
235
  /**
236
   * Peek the packet in the front of the queue. The packet is not removed.
237
   * Use this method instead of Peek.
238
   *
239
   * \return the packet
240
   */
241
  Ptr<const Item> PeekFront (void);
242
  /**
235
   * Search and return, if present in the queue, the first packet having the
243
   * Search and return, if present in the queue, the first packet having the
236
   * address indicated by <i>type</i> equal to <i>addr</i>, and tid
244
   * address indicated by <i>type</i> equal to <i>addr</i>, and tid
237
   * equal to <i>tid</i>. This method does not remove the packet from the queue.
245
   * equal to <i>tid</i>. This method does not remove the packet from the queue.

Return to bug 2621