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