A Discrete-Event Network Simulator
API
ofswitch13-device-container.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 University of Campinas (Unicamp)
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: Luciano Jerez Chaves <ljerezchaves@gmail.com>
18  */
19 
20 #ifndef OFSWITCH13_DEVICE_CONTAINER_H
21 #define OFSWITCH13_DEVICE_CONTAINER_H
22 
23 #include <ns3/ofswitch13-device.h>
24 
25 #include <cstdint>
26 #include <vector>
27 
28 namespace ns3
29 {
30 
45 {
46  public:
48  typedef std::vector<Ptr<OFSwitch13Device>>::const_iterator Iterator;
49 
54 
62 
71  OFSwitch13DeviceContainer(std::string devName);
72 
90  const OFSwitch13DeviceContainer& b);
91 
111  Iterator Begin() const;
112 
132  Iterator End() const;
133 
154  uint32_t GetN() const;
155 
177  Ptr<OFSwitch13Device> Get(uint32_t i) const;
178 
185  void Add(OFSwitch13DeviceContainer other);
186 
192  void Add(Ptr<OFSwitch13Device> device);
193 
201  void Add(std::string deviceName);
202 
203  private:
204  std::vector<Ptr<OFSwitch13Device>> m_devices;
205 };
206 
207 } // namespace ns3
208 
209 #endif /* OFSWITCH13_DEVICE_CONTAINER_H */
Holds a vector of ns3::OFSwitch13Device pointers.
OFSwitch13DeviceContainer()
Create an empty OFSwitch13DeviceContainer.
std::vector< Ptr< OFSwitch13Device > >::const_iterator Iterator
OFSwitch13Device container iterator.
void Add(OFSwitch13DeviceContainer other)
Append the contents of another OFSwitch13DeviceContainer to the end of this container.
std::vector< Ptr< OFSwitch13Device > > m_devices
OFSwitch13Device pointers.
Ptr< OFSwitch13Device > Get(uint32_t i) const
Get the Ptr<OFSwitch13Device> stored in this container at a given index.
uint32_t GetN() const
Get the number of Ptr<OFSwitch13Device> stored in this container.
Iterator Begin() const
Get an iterator which refers to the first OpenFlow device in the container.
Iterator End() const
Get an iterator which indicates past-the-last OpenFlow device in the container.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
Every class exported by the ns3 library is enclosed in the ns3 namespace.