A Discrete-Event Network Simulator
API
drop-tail-queue.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007 University of Washington
4  *
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
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */
18 
19 #ifndef DROPTAIL_H
20 #define DROPTAIL_H
21 
22 #include <queue>
23 #include "ns3/queue.h"
24 
25 namespace ns3 {
26 
32 class DropTailQueue : public Queue
33 {
34 public:
39  static TypeId GetTypeId (void);
45  DropTailQueue ();
46 
47  virtual ~DropTailQueue();
48 
49 private:
50  virtual bool DoEnqueue (Ptr<QueueItem> item);
51  virtual Ptr<QueueItem> DoDequeue (void);
52  virtual Ptr<QueueItem> DoRemove (void);
53  virtual Ptr<const QueueItem> DoPeek (void) const;
54 
55  std::queue<Ptr<QueueItem> > m_packets;
56 };
57 
58 } // namespace ns3
59 
60 #endif /* DROPTAIL_H */
virtual bool DoEnqueue(Ptr< QueueItem > item)
Push an item in the queue.
static TypeId GetTypeId(void)
Get the type ID.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
virtual Ptr< QueueItem > DoDequeue(void)
Pull the item to dequeue from the queue.
std::queue< Ptr< QueueItem > > m_packets
the items in the queue
Abstract base class for packet Queues.
Definition: queue.h:44
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual Ptr< const QueueItem > DoPeek(void) const
Peek the front item in the queue.
virtual Ptr< QueueItem > DoRemove(void)
Pull the item to drop from the queue.
DropTailQueue()
DropTailQueue Constructor.
a unique identifier for an interface.
Definition: type-id.h:58
A FIFO packet queue that drops tail-end packets on overflow.