Update README and add contrib dir
This commit is contained in:
59
contrib/ethernet/model/switch-channel.h
Normal file
59
contrib/ethernet/model/switch-channel.h
Normal file
@@ -0,0 +1,59 @@
|
||||
#ifndef SWITCH_CHANNEL_H
|
||||
#define SWITCH_CHANNEL_H
|
||||
|
||||
#include "ns3/channel.h"
|
||||
#include "ns3/net-device.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup ethernet
|
||||
* ns3::SwitchChannel declaration.
|
||||
*/
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
|
||||
/**
|
||||
* \ingroup bridge
|
||||
*
|
||||
* \brief Virtual channel implementation for bridges (BridgeNetDevice).
|
||||
*
|
||||
* Just like SwitchNetDevice aggregates multiple NetDevices,
|
||||
* SwitchChannel aggregates multiple channels and make them appear as
|
||||
* a single channel to upper layers.
|
||||
* This class is greatly inspire form BridgeChannel
|
||||
*/
|
||||
class SwitchChannel : public Channel
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Get the type ID.
|
||||
* \return the object TypeId
|
||||
*/
|
||||
static TypeId GetTypeId();
|
||||
SwitchChannel();
|
||||
~SwitchChannel() override;
|
||||
|
||||
// Delete copy constructor and assignment operator to avoid misuse
|
||||
SwitchChannel(const SwitchChannel&) = delete;
|
||||
SwitchChannel& operator=(const SwitchChannel&) = delete;
|
||||
|
||||
/**
|
||||
* Adds a channel to the bridged pool
|
||||
* \param bridgedChannel the channel to add to the pool
|
||||
*/
|
||||
void AddChannel(Ptr<Channel> bridgedChannel);
|
||||
|
||||
// virtual methods implementation, from Channel
|
||||
std::size_t GetNDevices() const override;
|
||||
Ptr<NetDevice> GetDevice(std::size_t i) const override;
|
||||
|
||||
private:
|
||||
std::vector<Ptr<Channel>> m_switchedChannels; //!< pool of switched channels
|
||||
};
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
#endif /* SWITCH_CHANNEL_H */
|
||||
Reference in New Issue
Block a user