A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
prio-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 PRIO_QUEUE_DISC_H
22
#define PRIO_QUEUE_DISC_H
23
24
#include "ns3/queue-disc.h"
25
#include <array>
26
27
namespace
ns3
{
28
30
typedef
std::array<uint16_t, 16>
Priomap
;
31
50
class
PrioQueueDisc
:
public
QueueDisc
{
51
public
:
56
static
TypeId
GetTypeId
(
void
);
60
PrioQueueDisc
();
61
62
virtual
~PrioQueueDisc
();
63
70
void
SetBandForPriority
(uint8_t prio, uint16_t band);
71
78
uint16_t
GetBandForPriority
(uint8_t prio)
const
;
79
80
private
:
81
virtual
bool
DoEnqueue
(
Ptr<QueueDiscItem>
item);
82
virtual
Ptr<QueueDiscItem>
DoDequeue
(
void
);
83
virtual
Ptr<const QueueDiscItem>
DoPeek
(
void
);
84
virtual
bool
CheckConfig
(
void
);
85
virtual
void
InitializeParams
(
void
);
86
87
Priomap
m_prio2band
;
88
};
89
98
std::ostream &
operator <<
(std::ostream &os,
const
Priomap
&priomap);
99
108
std::istream &
operator >>
(std::istream &is,
Priomap
&priomap);
109
110
111
ATTRIBUTE_HELPER_HEADER
(
Priomap
);
112
113
}
// namespace ns3
114
115
#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:50
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:83
ns3::PrioQueueDisc::CheckConfig
virtual bool CheckConfig(void)
Check whether the current configuration is correct.
Definition:
prio-queue-disc.cc:185
ns3::PrioQueueDisc::InitializeParams
virtual void InitializeParams(void)
Initialize parameters (if any) before the first packet is enqueued.
Definition:
prio-queue-disc.cc:219
ns3::PrioQueueDisc::DoDequeue
virtual Ptr< QueueDiscItem > DoDequeue(void)
This function actually extracts a packet from the queue disc.
Definition:
prio-queue-disc.cc:143
ns3::PrioQueueDisc::DoPeek
virtual Ptr< const QueueDiscItem > DoPeek(void)
Return a copy of the next packet the queue disc will extract.
Definition:
prio-queue-disc.cc:164
ns3::PrioQueueDisc::DoEnqueue
virtual bool DoEnqueue(Ptr< QueueDiscItem > item)
This function actually enqueues a packet into the queue disc.
Definition:
prio-queue-disc.cc:103
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:93
ns3::PrioQueueDisc::PrioQueueDisc
PrioQueueDisc()
PrioQueueDisc constructor.
Definition:
prio-queue-disc.cc:71
ns3::PrioQueueDisc::m_prio2band
Priomap m_prio2band
Priority to band mapping.
Definition:
prio-queue-disc.h:87
ns3::PrioQueueDisc::~PrioQueueDisc
virtual ~PrioQueueDisc()
Definition:
prio-queue-disc.cc:77
ns3::PrioQueueDisc::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
prio-queue-disc.cc:57
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:74
ns3::QueueDisc
QueueDisc is an abstract base class providing the interface and implementing the operations common to...
Definition:
queue-disc.h:181
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ATTRIBUTE_HELPER_HEADER
#define ATTRIBUTE_HELPER_HEADER(type)
Declare the attribute value, accessor and checkers for class type
Definition:
attribute-helper.h:390
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::operator>>
std::istream & operator>>(std::istream &is, Angles &a)
Definition:
angles.cc:162
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:139
ns3::Priomap
std::array< uint16_t, 16 > Priomap
Priority map.
Definition:
prio-queue-disc.h:30
src
traffic-control
model
prio-queue-disc.h
Generated on Tue Feb 6 2024 19:21:28 for ns-3 by
1.9.1