A Discrete-Event Network Simulator
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 
41 {
42 public:
46  typedef std::vector<std::pair<Ptr<QKDControl>, uint32_t> >::const_iterator Iterator;
47 
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;
138 
139 };
140 
141 } // namespace ns3
142 
143 #endif /* QKD_CONTROL_CONTAINER_H */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
holds a vector of std::pair of Ptr<QKDControl> and interface index.
std::vector< std::pair< Ptr< QKDControl >, uint32_t > > InterfaceVector
Container for pairs of QKDControl smart pointer / Interface Index.
std::vector< std::pair< Ptr< QKDControl >, uint32_t > >::const_iterator Iterator
Container Const Iterator for pairs of QKDControl smart pointer / Interface Index.
InterfaceVector m_list
List of QKD Encryptors and interfaces index.
Iterator Begin(void) const
Get an iterator which refers to the first pair in the container.
uint32_t GetN(void) const
Get the number of nodes in the container.
Iterator End(void) 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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.