A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
qkd-encryptor-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_ENCRYPTOR_CONTAINER_H
22
#define QKD_ENCRYPTOR_CONTAINER_H
23
24
#include <stdint.h>
25
#include <vector>
26
#include "ns3/qkd-encryptor.h"
27
#include "ns3/node.h"
28
29
namespace
ns3
{
30
41
class
QKDEncryptorContainer
42
{
43
public
:
47
typedef
std::vector<std::pair<Ptr<QKDEncryptor>, uint32_t> >::const_iterator
Iterator
;
48
52
QKDEncryptorContainer
();
53
58
void
Add
(
const
QKDEncryptorContainer
& other);
59
80
Iterator
Begin
(
void
)
const
;
81
102
Iterator
End
(
void
)
const
;
103
108
uint32_t
GetN
(
void
)
const
;
109
115
void
Add
(
Ptr<QKDEncryptor>
, uint32_t ipInterfacePair);
116
122
void
Add
(std::pair<
Ptr<QKDEncryptor>
, uint32_t> ipInterfacePair);
123
132
std::pair<Ptr<QKDEncryptor>, uint32_t>
Get
(uint32_t i)
const
;
133
134
private
:
135
typedef
std::vector<std::pair<Ptr<QKDEncryptor>,uint32_t> >
InterfaceVector
;
136
InterfaceVector
m_list
;
137
};
138
139
}
// namespace ns3
140
141
#endif
/* QKD_ENCRYPTOR_CONTAINER_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::QKDEncryptorContainer
holds a vector of std::pair of Ptr<QKDEncryptor> and interface index.
Definition:
qkd-encryptor-container.h:42
ns3::QKDEncryptorContainer::QKDEncryptorContainer
QKDEncryptorContainer()
Constructor.
Definition:
qkd-encryptor-container.cc:27
ns3::QKDEncryptorContainer::Get
std::pair< Ptr< QKDEncryptor >, uint32_t > Get(uint32_t i) const
Get the pair of the QKD encryptor and interface stored at the location specified by the index.
Definition:
qkd-encryptor-container.cc:69
ns3::QKDEncryptorContainer::InterfaceVector
std::vector< std::pair< Ptr< QKDEncryptor >, uint32_t > > InterfaceVector
Container for pairs of QKDEncryptor smart pointer / Interface Index.
Definition:
qkd-encryptor-container.h:135
ns3::QKDEncryptorContainer::GetN
uint32_t GetN(void) const
Get number of nodes withing the container.
Definition:
qkd-encryptor-container.cc:53
ns3::QKDEncryptorContainer::End
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
Definition:
qkd-encryptor-container.cc:47
ns3::QKDEncryptorContainer::m_list
InterfaceVector m_list
List of QKD Encryptors and interfaces index.
Definition:
qkd-encryptor-container.h:136
ns3::QKDEncryptorContainer::Add
void Add(const QKDEncryptorContainer &other)
Concatenate the entries in the other container with ours.
Definition:
qkd-encryptor-container.cc:32
ns3::QKDEncryptorContainer::Iterator
std::vector< std::pair< Ptr< QKDEncryptor >, uint32_t > >::const_iterator Iterator
Container Const Iterator for pairs of QKDEncryptor smart pointer / Interface Index.
Definition:
qkd-encryptor-container.h:47
ns3::QKDEncryptorContainer::Begin
Iterator Begin(void) const
Get an iterator which refers to the first pair in the container.
Definition:
qkd-encryptor-container.cc:41
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
qkd
helper
qkd-encryptor-container.h
Generated on Sun Mar 3 2024 17:11:07 for ns-3 by
1.9.1