A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
fifo-queue-disc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 Universita' degli Studi di Napoli Federico II
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors: Stefano Avallone <stavallo@unina.it>
18 */
19
20#ifndef FIFO_QUEUE_DISC_H
21#define FIFO_QUEUE_DISC_H
22
23#include "queue-disc.h"
24
25namespace ns3
26{
27
28/**
29 * \ingroup traffic-control
30 *
31 * Simple queue disc implementing the FIFO (First-In First-Out) policy.
32 *
33 */
35{
36 public:
37 /**
38 * \brief Get the type ID.
39 * \return the object TypeId
40 */
41 static TypeId GetTypeId();
42 /**
43 * \brief FifoQueueDisc constructor
44 *
45 * Creates a queue with a depth of 1000 packets by default
46 */
48
49 ~FifoQueueDisc() override;
50
51 // Reasons for dropping packets
52 static constexpr const char* LIMIT_EXCEEDED_DROP =
53 "Queue disc limit exceeded"; //!< Packet dropped due to queue disc limit exceeded
54
55 private:
56 bool DoEnqueue(Ptr<QueueDiscItem> item) override;
59 bool CheckConfig() override;
60 void InitializeParams() override;
61};
62
63} // namespace ns3
64
65#endif /* FIFO_QUEUE_DISC_H */
Simple queue disc implementing the FIFO (First-In First-Out) policy.
FifoQueueDisc()
FifoQueueDisc constructor.
Ptr< const QueueDiscItem > DoPeek() override
Return a copy of the next packet the queue disc will extract.
Ptr< QueueDiscItem > DoDequeue() override
This function actually extracts a packet from the queue disc.
bool CheckConfig() override
Check whether the current configuration is correct.
void InitializeParams() override
Initialize parameters (if any) before the first packet is enqueued.
bool DoEnqueue(Ptr< QueueDiscItem > item) override
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.
static TypeId GetTypeId()
Get the type ID.
~FifoQueueDisc() override
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Definition: queue-disc.h:184
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.