A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
qkd-control-container.cc
Go to the documentation of this file.
1
/*
2
* Copyright(c) 2020 DOTFEESA www.tk.etf.unsa.ba
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
*
7
*
8
* Author: Miralem Mehic <miralem.mehic@ieee.org>
9
*/
10
11
#include "
qkd-control-container.h
"
12
#include "ns3/node-list.h"
13
#include "ns3/names.h"
14
15
namespace
ns3
{
16
17
QKDControlContainer::QKDControlContainer
()
18
{
19
}
20
21
void
22
QKDControlContainer::Add
(
const
QKDControlContainer
&
other
)
23
{
24
for
(InterfaceVector::const_iterator
i
=
other
.m_list.begin();
i
!=
other
.m_list.end();
i
++)
25
{
26
m_list
.push_back(*
i
);
27
}
28
}
29
30
QKDControlContainer::Iterator
31
QKDControlContainer::Begin
()
const
32
{
33
return
m_list
.begin();
34
}
35
36
QKDControlContainer::Iterator
37
QKDControlContainer::End
()
const
38
{
39
return
m_list
.end();
40
}
41
42
uint32_t
43
QKDControlContainer::GetN
()
const
44
{
45
return
m_list
.size();
46
}
47
48
void
49
QKDControlContainer::Add
(
Ptr<QKDControl>
qkde
,
uint32_t
interface)
50
{
51
m_list
.push_back(std::make_pair(
qkde
, interface));
52
}
53
void
QKDControlContainer::Add
(std::pair<
Ptr<QKDControl>
,
uint32_t
>
a
)
54
{
55
Add
(
a
.first,
a
.second);
56
}
57
58
std::pair<Ptr<QKDControl>,
uint32_t
>
59
QKDControlContainer::Get
(
uint32_t
i
)
const
60
{
61
return
m_list
[
i
];
62
}
63
64
65
}
// namespace ns3
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:66
ns3::QKDControlContainer
holds a vector of std::pair of Ptr<QKDControl> and interface index.
Definition
qkd-control-container.h:31
ns3::QKDControlContainer::m_list
InterfaceVector m_list
List of QKD Encryptors and interfaces index.
Definition
qkd-control-container.h:151
ns3::QKDControlContainer::Iterator
std::vector< std::pair< Ptr< QKDControl >, uint32_t > >::const_iterator Iterator
Container Const Iterator for pairs of QKDControl smart pointer / Interface Index.
Definition
qkd-control-container.h:36
ns3::QKDControlContainer::QKDControlContainer
QKDControlContainer()
Create an empty QKDControlContainer.
Definition
qkd-control-container.cc:17
ns3::QKDControlContainer::GetN
uint32_t GetN() const
Definition
qkd-control-container.cc:43
ns3::QKDControlContainer::End
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
Definition
qkd-control-container.cc:37
ns3::QKDControlContainer::Add
void Add(const QKDControlContainer &other)
Concatenate the entries in the other container with ours.
Definition
qkd-control-container.cc:22
ns3::QKDControlContainer::Get
std::pair< Ptr< QKDControl >, uint32_t > Get(uint32_t i) const
Get the std::pair of an Ptr<QKDControl> and interface stored at the location specified by the index.
Definition
qkd-control-container.cc:59
ns3::QKDControlContainer::Begin
Iterator Begin() const
Get an iterator which refers to the first pair in the container.
Definition
qkd-control-container.cc:31
uint32_t
ns3::Create
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition
ptr.h:436
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
qkd-control-container.h
src
qkd
helper
qkd-control-container.cc
Generated on Mon Dec 15 2025 15:22:03 for ns-3 by
1.9.8