A Discrete-Event Network Simulator
API
bridge-channel.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License version 2 as
4  * published by the Free Software Foundation;
5  *
6  * This program is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  *
11  * You should have received a copy of the GNU General Public License
12  * along with this program; if not, write to the Free Software
13  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14  *
15  * Author: Gustavo Carneiro <gjc@inescporto.pt>
16  */
17 #ifndef BRIDGE_CHANNEL_H
18 #define BRIDGE_CHANNEL_H
19 
20 #include "ns3/channel.h"
21 #include "ns3/net-device.h"
22 
23 #include <vector>
24 
31 namespace ns3
32 {
33 
43 class BridgeChannel : public Channel
44 {
45  public:
50  static TypeId GetTypeId();
51  BridgeChannel();
52  ~BridgeChannel() override;
53 
54  // Delete copy constructor and assignment operator to avoid misuse
55  BridgeChannel(const BridgeChannel&) = delete;
57 
62  void AddChannel(Ptr<Channel> bridgedChannel);
63 
64  // virtual methods implementation, from Channel
65  std::size_t GetNDevices() const override;
66  Ptr<NetDevice> GetDevice(std::size_t i) const override;
67 
68  private:
69  std::vector<Ptr<Channel>> m_bridgedChannels;
70 };
71 
72 } // namespace ns3
73 
74 #endif /* BRIDGE_CHANNEL_H */
Virtual channel implementation for bridges (BridgeNetDevice).
~BridgeChannel() override
void AddChannel(Ptr< Channel > bridgedChannel)
Adds a channel to the bridged pool.
BridgeChannel(const BridgeChannel &)=delete
static TypeId GetTypeId()
Get the type ID.
std::vector< Ptr< Channel > > m_bridgedChannels
pool of bridged channels
std::size_t GetNDevices() const override
BridgeChannel & operator=(const BridgeChannel &)=delete
Ptr< NetDevice > GetDevice(std::size_t i) const override
Abstract Channel Base Class.
Definition: channel.h:45
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.