A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
traffic-control
helper
queue-disc-container.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2015 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
* Author: Stefano Avallone <stavallo@unina.it>
19
*/
20
21
#include "
queue-disc-container.h
"
22
23
namespace
ns3
{
24
25
QueueDiscContainer::QueueDiscContainer
()
26
{
27
}
28
29
QueueDiscContainer::QueueDiscContainer
(
Ptr<QueueDisc>
qDisc)
30
{
31
m_queueDiscs
.push_back (qDisc);
32
}
33
34
QueueDiscContainer::ConstIterator
35
QueueDiscContainer::Begin
(
void
)
const
36
{
37
return
m_queueDiscs
.begin ();
38
}
39
40
QueueDiscContainer::ConstIterator
41
QueueDiscContainer::End
(
void
)
const
42
{
43
return
m_queueDiscs
.end ();
44
}
45
46
std::size_t
47
QueueDiscContainer::GetN
(
void
)
const
48
{
49
return
m_queueDiscs
.size ();
50
}
51
52
Ptr<QueueDisc>
53
QueueDiscContainer::Get
(std::size_t i)
const
54
{
55
return
m_queueDiscs
[i];
56
}
57
58
void
59
QueueDiscContainer::Add
(
QueueDiscContainer
other)
60
{
61
for
(
ConstIterator
i = other.
Begin
(); i != other.
End
(); i++)
62
{
63
m_queueDiscs
.push_back (*i);
64
}
65
}
66
67
void
68
QueueDiscContainer::Add
(
Ptr<QueueDisc>
qDisc)
69
{
70
m_queueDiscs
.push_back (qDisc);
71
}
72
73
}
// namespace ns3
ns3::Ptr< QueueDisc >
ns3::QueueDiscContainer::m_queueDiscs
std::vector< Ptr< QueueDisc > > m_queueDiscs
QueueDiscs smart pointers.
Definition:
queue-disc-container.h:166
ns3::QueueDiscContainer::End
ConstIterator End(void) const
Get a const iterator which indicates past-the-last QueueDisc in the container.
Definition:
queue-disc-container.cc:41
ns3::QueueDiscContainer::QueueDiscContainer
QueueDiscContainer()
Create an empty QueueDiscContainer.
Definition:
queue-disc-container.cc:25
ns3::QueueDiscContainer::GetN
std::size_t GetN(void) const
Get the number of Ptr<QueueDisc> stored in this container.
Definition:
queue-disc-container.cc:47
queue-disc-container.h
ns3::QueueDiscContainer::ConstIterator
std::vector< Ptr< QueueDisc > >::const_iterator ConstIterator
QueueDisc container const iterator.
Definition:
queue-disc-container.h:48
ns3::QueueDiscContainer
Holds a vector of ns3::QueueDisc pointers.
Definition:
queue-disc-container.h:44
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::QueueDiscContainer::Get
Ptr< QueueDisc > Get(std::size_t i) const
Get the Ptr<QueueDisc> stored in this container at a given index.
Definition:
queue-disc-container.cc:53
ns3::QueueDiscContainer::Add
void Add(QueueDiscContainer other)
Append the contents of another QueueDiscContainer to the end of this container.
Definition:
queue-disc-container.cc:59
ns3::QueueDiscContainer::Begin
ConstIterator Begin(void) const
Get a const iterator which refers to the first QueueDisc in the container.
Definition:
queue-disc-container.cc:35
Generated on Wed Nov 7 2018 10:02:11 for ns-3 by
1.8.14