A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
prio-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 PRIO_QUEUE_DISC_H
21
#define PRIO_QUEUE_DISC_H
22
23
#include "
queue-disc.h
"
24
25
#include <array>
26
27
namespace
ns3
28
{
29
31
typedef
std::array<uint16_t, 16>
Priomap
;
32
51
class
PrioQueueDisc
:
public
QueueDisc
52
{
53
public
:
58
static
TypeId
GetTypeId
();
62
PrioQueueDisc
();
63
64
~PrioQueueDisc
()
override
;
65
72
void
SetBandForPriority
(uint8_t prio, uint16_t band);
73
80
uint16_t
GetBandForPriority
(uint8_t prio)
const
;
81
82
private
:
83
bool
DoEnqueue
(
Ptr<QueueDiscItem>
item)
override
;
84
Ptr<QueueDiscItem>
DoDequeue
()
override
;
85
Ptr<const QueueDiscItem>
DoPeek
()
override
;
86
bool
CheckConfig
()
override
;
87
void
InitializeParams
()
override
;
88
89
Priomap
m_prio2band
;
90
};
91
100
std::ostream&
operator<<
(std::ostream& os,
const
Priomap
& priomap);
101
110
std::istream&
operator>>
(std::istream& is,
Priomap
& priomap);
111
112
ATTRIBUTE_HELPER_HEADER
(
Priomap
);
113
114
}
// namespace ns3
115
116
#endif
/* PRIO_QUEUE_DISC_H */
ns3::PrioQueueDisc
The Prio qdisc is a simple classful queueing discipline that contains an arbitrary number of classes ...
Definition:
prio-queue-disc.h:52
ns3::PrioQueueDisc::SetBandForPriority
void SetBandForPriority(uint8_t prio, uint16_t band)
Set the band (class) assigned to packets with specified priority.
Definition:
prio-queue-disc.cc:89
ns3::PrioQueueDisc::~PrioQueueDisc
~PrioQueueDisc() override
Definition:
prio-queue-disc.cc:83
ns3::PrioQueueDisc::DoPeek
Ptr< const QueueDiscItem > DoPeek() override
Return a copy of the next packet the queue disc will extract.
Definition:
prio-queue-disc.cc:172
ns3::PrioQueueDisc::DoDequeue
Ptr< QueueDiscItem > DoDequeue() override
This function actually extracts a packet from the queue disc.
Definition:
prio-queue-disc.cc:150
ns3::PrioQueueDisc::GetBandForPriority
uint16_t GetBandForPriority(uint8_t prio) const
Get the band (class) assigned to packets with specified priority.
Definition:
prio-queue-disc.cc:99
ns3::PrioQueueDisc::CheckConfig
bool CheckConfig() override
Check whether the current configuration is correct.
Definition:
prio-queue-disc.cc:194
ns3::PrioQueueDisc::PrioQueueDisc
PrioQueueDisc()
PrioQueueDisc constructor.
Definition:
prio-queue-disc.cc:77
ns3::PrioQueueDisc::m_prio2band
Priomap m_prio2band
Priority to band mapping.
Definition:
prio-queue-disc.h:89
ns3::PrioQueueDisc::DoEnqueue
bool DoEnqueue(Ptr< QueueDiscItem > item) override
This function actually enqueues a packet into the queue disc.
Definition:
prio-queue-disc.cc:109
ns3::PrioQueueDisc::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
prio-queue-disc.cc:62
ns3::PrioQueueDisc::InitializeParams
void InitializeParams() override
Initialize parameters (if any) before the first packet is enqueued.
Definition:
prio-queue-disc.cc:228
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::QueueDisc
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Definition:
queue-disc.h:184
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::ATTRIBUTE_HELPER_HEADER
ATTRIBUTE_HELPER_HEADER(ValueClassTest)
ns3::operator>>
std::istream & operator>>(std::istream &is, Angles &a)
Definition:
angles.cc:183
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:159
ns3::Priomap
std::array< uint16_t, 16 > Priomap
Priority map.
Definition:
prio-queue-disc.h:31
queue-disc.h
src
traffic-control
model
prio-queue-disc.h
Generated on Sun Mar 3 2024 17:11:09 for ns-3 by
1.9.1