A Discrete-Event Network Simulator
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
12#include "ns3/node-list.h"
13#include "ns3/names.h"
14
15namespace ns3 {
16
20
21void
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
32{
33 return m_list.begin();
34}
35
38{
39 return m_list.end();
40}
41
44{
45 return m_list.size();
46}
47
48void
50{
51 m_list.push_back(std::make_pair(qkde, interface));
52}
54{
55 Add(a.first, a.second);
56}
57
58std::pair<Ptr<QKDControl>, uint32_t>
60{
61 return m_list[i];
62}
63
64
65} // namespace ns3
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:66
holds a vector of std::pair of Ptr<QKDControl> and interface index.
InterfaceVector m_list
List of QKD Encryptors and interfaces index.
std::vector< std::pair< Ptr< QKDControl >, uint32_t > >::const_iterator Iterator
Container Const Iterator for pairs of QKDControl smart pointer / Interface Index.
QKDControlContainer()
Create an empty QKDControlContainer.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
void Add(const QKDControlContainer &other)
Concatenate the entries in the other container with ours.
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.
Iterator Begin() const
Get an iterator which refers to the first pair in the container.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Every class exported by the ns3 library is enclosed in the ns3 namespace.