A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
qkd-control-container.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2020 DOTFEESA www.tk.etf.unsa.ba
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: Miralem Mehic <miralem.mehic@ieee.org>
19
*/
20
21
#include "
qkd-control-container.h
"
22
#include "ns3/node-list.h"
23
#include "ns3/names.h"
24
25
namespace
ns3
{
26
27
QKDControlContainer::QKDControlContainer
()
28
{
29
}
30
31
void
32
QKDControlContainer::Add
(
const
QKDControlContainer
& other)
33
{
34
for
(InterfaceVector::const_iterator i = other.
m_list
.begin (); i != other.
m_list
.end (); i++)
35
{
36
m_list
.push_back (*i);
37
}
38
}
39
40
QKDControlContainer::Iterator
41
QKDControlContainer::Begin
(
void
)
const
42
{
43
return
m_list
.begin ();
44
}
45
46
QKDControlContainer::Iterator
47
QKDControlContainer::End
(
void
)
const
48
{
49
return
m_list
.end ();
50
}
51
52
uint32_t
53
QKDControlContainer::GetN
(
void
)
const
54
{
55
return
m_list
.size ();
56
}
57
58
void
59
QKDControlContainer::Add
(
Ptr<QKDControl>
qkde, uint32_t interface)
60
{
61
m_list
.push_back (std::make_pair (qkde, interface));
62
}
63
void
QKDControlContainer::Add
(std::pair<
Ptr<QKDControl>
, uint32_t> a)
64
{
65
Add
(a.first, a.second);
66
}
67
68
std::pair<Ptr<QKDControl>, uint32_t>
69
QKDControlContainer::Get
(uint32_t i)
const
70
{
71
return
m_list
[i];
72
}
73
74
75
}
// namespace ns3
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:74
ns3::QKDControlContainer
holds a vector of std::pair of Ptr<QKDControl> and interface index.
Definition:
qkd-control-container.h:41
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:46
ns3::QKDControlContainer::m_list
InterfaceVector m_list
List of QKD Encryptors and interfaces index.
Definition:
qkd-control-container.h:137
ns3::QKDControlContainer::QKDControlContainer
QKDControlContainer()
Constructor.
Definition:
qkd-control-container.cc:27
ns3::QKDControlContainer::Begin
Iterator Begin(void) const
Get an iterator which refers to the first pair in the container.
Definition:
qkd-control-container.cc:41
ns3::QKDControlContainer::GetN
uint32_t GetN(void) const
Get the number of nodes in the container.
Definition:
qkd-control-container.cc:53
ns3::QKDControlContainer::End
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
Definition:
qkd-control-container.cc:47
ns3::QKDControlContainer::Add
void Add(const QKDControlContainer &other)
Concatenate the entries in the other container with ours.
Definition:
qkd-control-container.cc:32
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:69
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 Tue Feb 6 2024 19:21:26 for ns-3 by
1.9.1