A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
qkd-control-container.h
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
#ifndef QKD_CONTROL_CONTAINER_H
22
#define QKD_CONTROL_CONTAINER_H
23
24
#include <stdint.h>
25
#include <vector>
26
#include "ns3/qkd-control.h"
27
28
namespace
ns3
{
29
40
class
QKDControlContainer
41
{
42
public
:
46
typedef
std::vector<std::pair<Ptr<QKDControl>, uint32_t> >::const_iterator
Iterator
;
47
51
QKDControlContainer
();
52
57
void
Add
(
const
QKDControlContainer
& other);
58
79
Iterator
Begin
(
void
)
const
;
80
101
Iterator
End
(
void
)
const
;
102
107
uint32_t
GetN
(
void
)
const
;
108
115
void
Add
(
Ptr<QKDControl>
, uint32_t ipInterfacePair);
116
123
void
Add
(std::pair<
Ptr<QKDControl>
, uint32_t> ipInterfacePair);
124
132
std::pair<Ptr<QKDControl>, uint32_t>
Get
(uint32_t i)
const
;
133
134
private
:
135
136
typedef
std::vector<std::pair<Ptr<QKDControl>,uint32_t> >
InterfaceVector
;
137
InterfaceVector
m_list
;
138
139
};
140
141
}
// namespace ns3
142
143
#endif
/* QKD_CONTROL_CONTAINER_H */
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::InterfaceVector
std::vector< std::pair< Ptr< QKDControl >, uint32_t > > InterfaceVector
Container for pairs of QKDControl smart pointer / Interface Index.
Definition:
qkd-control-container.h:136
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.
src
qkd
helper
qkd-control-container.h
Generated on Tue Feb 6 2024 19:21:26 for ns-3 by
1.9.1