A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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
25/**
26 * \file
27 * \ingroup bridge
28 * ns3::BridgeChannel declaration.
29 */
30
31namespace ns3
32{
33
34/**
35 * \ingroup bridge
36 *
37 * \brief Virtual channel implementation for bridges (BridgeNetDevice).
38 *
39 * Just like BridgeNetDevice aggregates multiple NetDevices,
40 * BridgeChannel aggregates multiple channels and make them appear as
41 * a single channel to upper layers.
42 */
43class BridgeChannel : public Channel
44{
45 public:
46 /**
47 * \brief Get the type ID.
48 * \return the object TypeId
49 */
50 static TypeId GetTypeId();
52 ~BridgeChannel() override;
53
54 // Delete copy constructor and assignment operator to avoid misuse
55 BridgeChannel(const BridgeChannel&) = delete;
57
58 /**
59 * Adds a channel to the bridged pool
60 * \param bridgedChannel the channel to add to the pool
61 */
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; //!< pool of bridged channels
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
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.