A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
bridge-channel.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-2.0-only
3 *
4 * Author: Gustavo Carneiro <gjc@inescporto.pt>
5 */
6#ifndef BRIDGE_CHANNEL_H
7#define BRIDGE_CHANNEL_H
8
9#include "ns3/channel.h"
10#include "ns3/net-device.h"
11
12#include <vector>
13
14/**
15 * \file
16 * \ingroup bridge
17 * ns3::BridgeChannel declaration.
18 */
19
20namespace ns3
21{
22
23/**
24 * \ingroup bridge
25 *
26 * \brief Virtual channel implementation for bridges (BridgeNetDevice).
27 *
28 * Just like BridgeNetDevice aggregates multiple NetDevices,
29 * BridgeChannel aggregates multiple channels and make them appear as
30 * a single channel to upper layers.
31 */
32class BridgeChannel : public Channel
33{
34 public:
35 /**
36 * \brief Get the type ID.
37 * \return the object TypeId
38 */
39 static TypeId GetTypeId();
41 ~BridgeChannel() override;
42
43 // Delete copy constructor and assignment operator to avoid misuse
44 BridgeChannel(const BridgeChannel&) = delete;
46
47 /**
48 * Adds a channel to the bridged pool
49 * \param bridgedChannel the channel to add to the pool
50 */
51 void AddChannel(Ptr<Channel> bridgedChannel);
52
53 // virtual methods implementation, from Channel
54 std::size_t GetNDevices() const override;
55 Ptr<NetDevice> GetDevice(std::size_t i) const override;
56
57 private:
58 std::vector<Ptr<Channel>> m_bridgedChannels; //!< pool of bridged channels
59};
60
61} // namespace ns3
62
63#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:34
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.