A Discrete-Event Network Simulator
API
fifo-queue-disc.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2017 Universita' degli Studi di Napoli Federico II
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  * Authors: Stefano Avallone <stavallo@unina.it>
19  */
20 
21 #ifndef FIFO_QUEUE_DISC_H
22 #define FIFO_QUEUE_DISC_H
23 
24 #include "ns3/queue-disc.h"
25 
26 namespace ns3 {
27 
34 class FifoQueueDisc : public QueueDisc {
35 public:
40  static TypeId GetTypeId (void);
46  FifoQueueDisc ();
47 
48  virtual ~FifoQueueDisc();
49 
50  // Reasons for dropping packets
51  static constexpr const char* LIMIT_EXCEEDED_DROP = "Queue disc limit exceeded";
52 
53 private:
54  virtual bool DoEnqueue (Ptr<QueueDiscItem> item);
55  virtual Ptr<QueueDiscItem> DoDequeue (void);
56  virtual Ptr<const QueueDiscItem> DoPeek (void);
57  virtual bool CheckConfig (void);
58  virtual void InitializeParams (void);
59 };
60 
61 } // namespace ns3
62 
63 #endif /* FIFO_QUEUE_DISC_H */
Simple queue disc implementing the FIFO (First-In First-Out) policy.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
virtual Ptr< const QueueDiscItem > DoPeek(void)
Return a copy of the next packet the queue disc will extract.
virtual bool DoEnqueue(Ptr< QueueDiscItem > item)
This function actually enqueues a packet into the queue disc.
static constexpr const char * LIMIT_EXCEEDED_DROP
Packet dropped due to queue disc limit exceeded.
virtual Ptr< QueueDiscItem > DoDequeue(void)
This function actually extracts a packet from the queue disc.
virtual void InitializeParams(void)
Initialize parameters (if any) before the first packet is enqueued.
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Definition: queue-disc.h:182
static TypeId GetTypeId(void)
Get the type ID.
FifoQueueDisc()
FifoQueueDisc constructor.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual bool CheckConfig(void)
Check whether the current configuration is correct.
a unique identifier for an interface.
Definition: type-id.h:58