src/node/queue.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon, 11 Aug 2008 10:40:31 -0700
changeset 3525 4b8ef7da0ac3
parent 3222 f61c17b62fd1
permissions -rw-r--r--
bug 275: Queue::Peek should return Ptr<const Packet>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
264
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
     2
/*
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
     3
 * Copyright (c) 2007 University of Washington
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
     4
 *
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
     7
 * published by the Free Software Foundation;
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
     8
 *
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    12
 * GNU General Public License for more details.
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    13
 *
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    17
 */
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    18
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    19
// The queue base class does not have any limit based on the number
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    20
// of packets or number of bytes. It is, conceptually, infinite 
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    21
// by default. Only subclasses define limitations.
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    22
// The base class implements tracing and basic statistics calculations.
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    23
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    24
#ifndef QUEUE_H
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    25
#define QUEUE_H
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    26
317
b5959aa4a02f fix queue tracing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 308
diff changeset
    27
#include <string>
439
fed13fb45eef Incorporated defaults and command-line arguments
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 378
diff changeset
    28
#include <list>
264
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    29
#include "ns3/packet.h"
710
2a9c061219a7 port code from Interface to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 627
diff changeset
    30
#include "ns3/object.h"
2534
0dd75c81244e re-implement tracing using Attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2251
diff changeset
    31
#include "ns3/traced-callback.h"
264
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    32
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    33
namespace ns3 {
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    34
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    35
/**
3183
fc3b2e03e61e more doxygen
Tom Henderson <tomh@tomh.org>
parents: 2834
diff changeset
    36
 * \ingroup node
fc3b2e03e61e more doxygen
Tom Henderson <tomh@tomh.org>
parents: 2834
diff changeset
    37
 * \defgroup queue Queue
3222
f61c17b62fd1 bug 202: classes disappeared from doxygen output
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3214
diff changeset
    38
 */
f61c17b62fd1 bug 202: classes disappeared from doxygen output
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3214
diff changeset
    39
/**
f61c17b62fd1 bug 202: classes disappeared from doxygen output
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3214
diff changeset
    40
 * \ingroup queue
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    41
 * \brief Abstract base class for packet Queues
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    42
 * 
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    43
 * This class defines the base APIs for packet queues in the ns-3 system
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    44
 */
710
2a9c061219a7 port code from Interface to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 627
diff changeset
    45
class Queue : public Object
264
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    46
{
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    47
public:
2251
04963d8cca51 iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2250
diff changeset
    48
  static TypeId GetTypeId (void);
581
15240a33f517 make Queue derive from Interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 439
diff changeset
    49
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents: 337
diff changeset
    50
  Queue ();
264
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    51
  virtual ~Queue ();
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    52
  
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    53
  /**
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    54
   * \return true if the queue is empty; false otherwise
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    55
   */
1860
cb17b9a8625b Bug 105: Queue getter methods should be const
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1412
diff changeset
    56
  bool IsEmpty (void) const;
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    57
  /**
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    58
   * Place a packet into the rear of the Queue
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    59
   * \return True if the operation was successful; false otherwise
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    60
   */
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1412
diff changeset
    61
  bool Enqueue (Ptr<Packet> p);
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    62
  /**
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    63
   * Remove a packet from the front of the Queue
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1412
diff changeset
    64
   * \return 0 if the operation was not successful; the packet otherwise.
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    65
   */
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1412
diff changeset
    66
  Ptr<Packet> Dequeue (void);
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    67
  /**
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    68
   * Get a copy of the item at the front of the queue without removing it
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1412
diff changeset
    69
   * \return 0 if the operation was not successful; the packet otherwise.
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    70
   */
3525
4b8ef7da0ac3 bug 275: Queue::Peek should return Ptr<const Packet>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3222
diff changeset
    71
  Ptr<const Packet> Peek (void) const;
264
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    72
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    73
  /**
3214
5c73d8f952bf bug 204: implement Queue::DequeueAll.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3183
diff changeset
    74
   * Flush the queue.
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    75
   */
337
42102ed8ee3c Fix bug 8: Enque/Deque misspelled
Tom Henderson <tomh@tomh.org>
parents: 317
diff changeset
    76
  void DequeueAll (void);
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    77
  /**
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    78
   * \return The number of packets currently stored in the Queue
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    79
   */
1860
cb17b9a8625b Bug 105: Queue getter methods should be const
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1412
diff changeset
    80
  uint32_t GetNPackets (void) const;
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    81
  /**
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    82
   * \return The number of bytes currently occupied by the packets in the Queue
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    83
   */
1860
cb17b9a8625b Bug 105: Queue getter methods should be const
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1412
diff changeset
    84
  uint32_t GetNBytes (void) const;
264
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
    85
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    86
  /**
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    87
   * \return The total number of bytes recieved by this Queue since the
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    88
   * simulation began, or since ResetStatistics was called, according to 
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    89
   * whichever happened more recently
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    90
   * 
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    91
   */
1860
cb17b9a8625b Bug 105: Queue getter methods should be const
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1412
diff changeset
    92
  uint32_t GetTotalReceivedBytes (void) const;
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    93
  /**
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    94
   * \return The total number of packets recieved by this Queue since the
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    95
   * simulation began, or since ResetStatistics was called, according to 
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    96
   * whichever happened more recently
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    97
   */
1860
cb17b9a8625b Bug 105: Queue getter methods should be const
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1412
diff changeset
    98
  uint32_t GetTotalReceivedPackets (void) const;
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
    99
  /**
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
   100
   * \return The total number of bytes dropped by this Queue since the
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
   101
   * simulation began, or since ResetStatistics was called, according to 
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
   102
   * whichever happened more recently
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
   103
   */
1860
cb17b9a8625b Bug 105: Queue getter methods should be const
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1412
diff changeset
   104
  uint32_t GetTotalDroppedBytes (void) const;
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
   105
  /**
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
   106
   * \return The total number of bytes dropped by this Queue since the
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
   107
   * simulation began, or since ResetStatistics was called, according to 
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
   108
   * whichever happened more recently
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
   109
   */
1860
cb17b9a8625b Bug 105: Queue getter methods should be const
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1412
diff changeset
   110
  uint32_t GetTotalDroppedPackets (void) const;
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
   111
  /**
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
   112
   * Resets the counts for dropped packets, dropped bytes, recieved packets, and
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
   113
   * recieved bytes.
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
   114
   */
264
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   115
  void ResetStatistics (void);
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   116
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   117
#if 0
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   118
  // average calculation requires keeping around
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   119
  // a buffer with the date of arrival of past received packets
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   120
  // which are within the average window
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   121
  // so, it is quite costly to do it all the time.
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   122
  // Hence, it is disabled by default and must be explicitely
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   123
  // enabled with this method which specifies the size
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   124
  // of the average window in time units.
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   125
  void EnableRunningAverage (Time averageWindow);
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   126
  void DisableRunningAverage (void);
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   127
  // average
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   128
  double GetQueueSizeAverage (void);
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   129
  double GetReceivedBytesPerSecondAverage (void);
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   130
  double GetReceivedPacketsPerSecondAverage (void);
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   131
  double GetDroppedBytesPerSecondAverage (void);
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   132
  double GetDroppedPacketsPerSecondAverage (void);
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   133
  // variance
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   134
  double GetQueueSizeVariance (void);
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   135
  double GetReceivedBytesPerSecondVariance (void);
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   136
  double GetReceivedPacketsPerSecondVariance (void);
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   137
  double GetDroppedBytesPerSecondVariance (void);
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   138
  double GetDroppedPacketsPerSecondVariance (void);
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   139
#endif
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   140
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   141
private:
627
f133ef9a1619 Queue dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 620
diff changeset
   142
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1412
diff changeset
   143
  virtual bool DoEnqueue (Ptr<Packet> p) = 0;
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1412
diff changeset
   144
  virtual Ptr<Packet> DoDequeue (void) = 0;
3525
4b8ef7da0ac3 bug 275: Queue::Peek should return Ptr<const Packet>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3222
diff changeset
   145
  virtual Ptr<const Packet> DoPeek (void) const = 0;
264
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   146
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   147
protected:
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   148
  // called by subclasses to notify parent of packet drops.
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1412
diff changeset
   149
  void Drop (Ptr<Packet> packet);
317
b5959aa4a02f fix queue tracing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 308
diff changeset
   150
b5959aa4a02f fix queue tracing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 308
diff changeset
   151
private:
2534
0dd75c81244e re-implement tracing using Attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2251
diff changeset
   152
  TracedCallback<Ptr<const Packet> > m_traceEnqueue;
0dd75c81244e re-implement tracing using Attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2251
diff changeset
   153
  TracedCallback<Ptr<const Packet> > m_traceDequeue;
0dd75c81244e re-implement tracing using Attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2251
diff changeset
   154
  TracedCallback<Ptr<const Packet> > m_traceDrop;
264
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   155
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   156
  uint32_t m_nBytes;
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   157
  uint32_t m_nTotalReceivedBytes;
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   158
  uint32_t m_nPackets;
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   159
  uint32_t m_nTotalReceivedPackets;
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   160
  uint32_t m_nTotalDroppedBytes;
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   161
  uint32_t m_nTotalDroppedPackets;
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   162
};
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   163
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   164
}; // namespace ns3
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   165
128d8d1bfb51 queues, trace-writer, debug
craigdo@m354-pc01.ee.washington.edu
parents:
diff changeset
   166
#endif /* QUEUE_H */