A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
mq-queue-disc.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2016 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: Pasquale Imputato <p.imputato@gmail.com>
19
* Stefano Avallone <stavallo@unina.it>
20
*/
21
22
#include "ns3/log.h"
23
#include "
mq-queue-disc.h
"
24
25
namespace
ns3
{
26
27
NS_LOG_COMPONENT_DEFINE
(
"MqQueueDisc"
);
28
29
NS_OBJECT_ENSURE_REGISTERED
(MqQueueDisc);
30
31
TypeId
MqQueueDisc::GetTypeId
(
void
)
32
{
33
static
TypeId
tid =
TypeId
(
"ns3::MqQueueDisc"
)
34
.
SetParent
<
QueueDisc
> ()
35
.SetGroupName (
"TrafficControl"
)
36
.AddConstructor<
MqQueueDisc
> ()
37
;
38
return
tid;
39
}
40
41
MqQueueDisc::MqQueueDisc
()
42
:
QueueDisc
(
QueueDiscSizePolicy
::
NO_LIMITS
)
43
{
44
NS_LOG_FUNCTION
(
this
);
45
}
46
47
MqQueueDisc::~MqQueueDisc
()
48
{
49
NS_LOG_FUNCTION
(
this
);
50
}
51
52
MqQueueDisc::WakeMode
53
MqQueueDisc::GetWakeMode
(
void
)
const
54
{
55
return
WAKE_CHILD
;
56
}
57
58
bool
59
MqQueueDisc::DoEnqueue
(
Ptr<QueueDiscItem>
item)
60
{
61
NS_FATAL_ERROR
(
"MqQueueDisc: DoEnqueue should never be called"
);
62
}
63
64
Ptr<QueueDiscItem>
65
MqQueueDisc::DoDequeue
(
void
)
66
{
67
NS_FATAL_ERROR
(
"MqQueueDisc: DoDequeue should never be called"
);
68
}
69
70
Ptr<const QueueDiscItem>
71
MqQueueDisc::DoPeek
(
void
)
72
{
73
NS_FATAL_ERROR
(
"MqQueueDisc: DoPeek should never be called"
);
74
}
75
76
bool
77
MqQueueDisc::CheckConfig
(
void
)
78
{
79
NS_LOG_FUNCTION
(
this
);
80
81
if
(
GetNPacketFilters
() > 0)
82
{
83
NS_LOG_ERROR
(
"MqQueueDisc cannot have packet filters"
);
84
return
false
;
85
}
86
87
if
(
GetNInternalQueues
() > 0)
88
{
89
NS_LOG_ERROR
(
"MqQueueDisc cannot have internal queues"
);
90
return
false
;
91
}
92
93
return
true
;
94
}
95
96
void
97
MqQueueDisc::InitializeParams
(
void
)
98
{
99
NS_LOG_FUNCTION
(
this
);
100
}
101
102
}
// namespace ns3
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition:
log.h:205
ns3::QueueDiscSizePolicy
QueueDiscSizePolicy
Enumeration of the available policies to handle the queue disc size.
Definition:
queue-disc.h:104
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:45
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::QueueDisc
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Definition:
queue-disc.h:181
ns3::MqQueueDisc::DoDequeue
virtual Ptr< QueueDiscItem > DoDequeue(void)
This function actually extracts a packet from the queue disc.
Definition:
mq-queue-disc.cc:65
ns3::NO_LIMITS
@ NO_LIMITS
Used by queue discs with unlimited size.
Definition:
queue-disc.h:108
ns3::QueueDisc::GetNPacketFilters
std::size_t GetNPacketFilters(void) const
Get the number of packet filters.
Definition:
queue-disc.cc:628
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:923
ns3::QueueDisc::WakeMode
WakeMode
Used to determine whether the queue disc itself or its children must be activated when a netdevice wa...
Definition:
queue-disc.h:497
ns3::MqQueueDisc::InitializeParams
virtual void InitializeParams(void)
Initialize parameters (if any) before the first packet is enqueued.
Definition:
mq-queue-disc.cc:97
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:74
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition:
fatal-error.h:165
ns3::MqQueueDisc::DoEnqueue
virtual bool DoEnqueue(Ptr< QueueDiscItem > item)
This function actually enqueues a packet into the queue disc.
Definition:
mq-queue-disc.cc:59
ns3::MqQueueDisc::GetWakeMode
WakeMode GetWakeMode(void) const
Return the wake mode adopted by this queue disc.
Definition:
mq-queue-disc.cc:53
ns3::MqQueueDisc::DoPeek
virtual Ptr< const QueueDiscItem > DoPeek(void)
Return a copy of the next packet the queue disc will extract.
Definition:
mq-queue-disc.cc:71
ns3::QueueDisc::GetNInternalQueues
std::size_t GetNInternalQueues(void) const
Get the number of internal queues.
Definition:
queue-disc.cc:608
ns3::MqQueueDisc::CheckConfig
virtual bool CheckConfig(void)
Check whether the current configuration is correct.
Definition:
mq-queue-disc.cc:77
ns3::QueueDisc::WAKE_CHILD
@ WAKE_CHILD
Definition:
queue-disc.h:499
ns3::MqQueueDisc::MqQueueDisc
MqQueueDisc()
MqQueueDisc constructor.
Definition:
mq-queue-disc.cc:41
NS_LOG_ERROR
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition:
log.h:257
ns3::MqQueueDisc
mq is a classful multi-queue aware dummy scheduler.
Definition:
mq-queue-disc.h:36
ns3::MqQueueDisc::~MqQueueDisc
virtual ~MqQueueDisc()
Definition:
mq-queue-disc.cc:47
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition:
log-macros-enabled.h:244
mq-queue-disc.h
ns3::MqQueueDisc::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
mq-queue-disc.cc:31
src
traffic-control
model
mq-queue-disc.cc
Generated on Fri Oct 1 2021 17:03:38 for ns-3 by
1.8.20