A Discrete-Event Network Simulator
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 
42 {
43 public:
47  typedef std::vector<std::pair<Ptr<QKDEncryptor>, uint32_t> >::const_iterator Iterator;
48 
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;
137 };
138 
139 } // namespace ns3
140 
141 #endif /* QKD_ENCRYPTOR_CONTAINER_H */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
holds a vector of std::pair of Ptr<QKDEncryptor> and interface index.
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.
std::vector< std::pair< Ptr< QKDEncryptor >, uint32_t > > InterfaceVector
Container for pairs of QKDEncryptor smart pointer / Interface Index.
uint32_t GetN(void) const
Get number of nodes withing the container.
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
InterfaceVector m_list
List of QKD Encryptors and interfaces index.
void Add(const QKDEncryptorContainer &other)
Concatenate the entries in the other container with ours.
std::vector< std::pair< Ptr< QKDEncryptor >, uint32_t > >::const_iterator Iterator
Container Const Iterator for pairs of QKDEncryptor smart pointer / Interface Index.
Iterator Begin(void) const
Get an iterator which refers to the first pair in the container.
Every class exported by the ns3 library is enclosed in the ns3 namespace.