A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
mq-queue-disc.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Pasquale Imputato <p.imputato@gmail.com>
7 * Stefano Avallone <stavallo@unina.it>
8 */
9
10#include "mq-queue-disc.h"
11
12#include "ns3/log.h"
13
14namespace ns3
15{
16
17NS_LOG_COMPONENT_DEFINE("MqQueueDisc");
18
20
21TypeId
23{
24 static TypeId tid = TypeId("ns3::MqQueueDisc")
26 .SetGroupName("TrafficControl")
27 .AddConstructor<MqQueueDisc>();
28 return tid;
29}
30
36
41
44{
45 return WAKE_CHILD;
46}
47
48bool
50{
51 NS_FATAL_ERROR("MqQueueDisc: DoEnqueue should never be called");
52}
53
56{
57 NS_FATAL_ERROR("MqQueueDisc: DoDequeue should never be called");
58}
59
62{
63 NS_FATAL_ERROR("MqQueueDisc: DoPeek should never be called");
64}
65
66bool
68{
69 NS_LOG_FUNCTION(this);
70
71 if (GetNPacketFilters() > 0)
72 {
73 NS_LOG_ERROR("MqQueueDisc cannot have packet filters");
74 return false;
75 }
76
77 if (GetNInternalQueues() > 0)
78 {
79 NS_LOG_ERROR("MqQueueDisc cannot have internal queues");
80 return false;
81 }
82
83 return true;
84}
85
86void
91
92} // namespace ns3
mq is a classful multi-queue aware dummy scheduler.
Ptr< QueueDiscItem > DoDequeue() override
This function actually extracts a packet from the queue disc.
Ptr< const QueueDiscItem > DoPeek() override
Return a copy of the next packet the queue disc will extract.
void InitializeParams() override
Initialize parameters (if any) before the first packet is enqueued.
MqQueueDisc()
MqQueueDisc constructor.
static TypeId GetTypeId()
Get the type ID.
bool DoEnqueue(Ptr< QueueDiscItem > item) override
This function actually enqueues a packet into the queue disc.
bool CheckConfig() override
Check whether the current configuration is correct.
~MqQueueDisc() override
WakeMode GetWakeMode() const override
Return the wake mode adopted by this queue disc.
Smart pointer class similar to boost::intrusive_ptr.
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Definition queue-disc.h:173
WakeMode
Used to determine whether the queue disc itself or its children must be activated when a netdevice wa...
Definition queue-disc.h:492
std::size_t GetNPacketFilters() const
Get the number of packet filters.
std::size_t GetNInternalQueues() const
Get the number of internal queues.
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition log.h:243
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
QueueDiscSizePolicy
Enumeration of the available policies to handle the queue disc size.
Definition queue-disc.h:96
@ NO_LIMITS
Used by queue discs with unlimited size.
Definition queue-disc.h:100
Every class exported by the ns3 library is enclosed in the ns3 namespace.