A Discrete-Event Network Simulator
QKDNetSim v2.0 (NS-3 v3.41) @ (+)
API
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
net-device-container.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 INRIA
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18  */
19 #ifndef NET_DEVICE_CONTAINER_H
20 #define NET_DEVICE_CONTAINER_H
21 
22 #include "ns3/net-device.h"
23 
24 #include <stdint.h>
25 #include <vector>
26 
27 namespace ns3
28 {
29 
43 {
44  public:
46  typedef std::vector<Ptr<NetDevice>>::const_iterator Iterator;
47 
52 
60 
70  NetDeviceContainer(std::string devName);
71 
88 
108  Iterator Begin() const;
109 
129  Iterator End() const;
130 
151  uint32_t GetN() const;
152 
174  Ptr<NetDevice> Get(uint32_t i) const;
175 
182  void Add(NetDeviceContainer other);
183 
189  void Add(Ptr<NetDevice> device);
190 
197  void Add(std::string deviceName);
198 
199  private:
200  std::vector<Ptr<NetDevice>> m_devices;
201 };
202 
203 } // namespace ns3
204 
205 #endif /* NET_DEVICE_CONTAINER_H */
holds a vector of ns3::NetDevice pointers
uint32_t GetN() const
Get the number of Ptr<NetDevice> stored in this container.
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
Iterator Begin() const
Get an iterator which refers to the first NetDevice in the container.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
std::vector< Ptr< NetDevice > > m_devices
NetDevices smart pointers.
Iterator End() const
Get an iterator which indicates past-the-last NetDevice in the container.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
NetDeviceContainer()
Create an empty NetDeviceContainer.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Every class exported by the ns3 library is enclosed in the ns3 namespace.