A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wimax-channel.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007,2008 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
7 */
8
9#ifndef WIMAX_CHANNEL_H
10#define WIMAX_CHANNEL_H
11
12#include "wimax-connection.h"
13
14#include "ns3/channel.h"
15#include "ns3/log.h"
16
17#include <list>
18
19namespace ns3
20{
21
22class WimaxPhy;
23class Packet;
24class Position;
25class PacketBurst;
26
27/**
28 * \ingroup wimax
29 * The channel object to attach Wimax NetDevices
30 */
31class WimaxChannel : public Channel
32{
33 public:
34 /**
35 * \brief Get the type ID.
36 * \return the object TypeId
37 */
38 static TypeId GetTypeId();
40 ~WimaxChannel() override;
41 /**
42 * \brief attach the channel to a physical layer of a device
43 * \param phy the physical layer to which the channel will be attached
44 */
45 void Attach(Ptr<WimaxPhy> phy);
46 /**
47 * \return the number of attached devices
48 */
49 std::size_t GetNDevices() const override;
50 /**
51 * \param i the ith device
52 * \return the ith attached device
53 */
54 Ptr<NetDevice> GetDevice(std::size_t i) const override;
55
56 /**
57 * Assign a fixed random variable stream number to the random variables
58 * used by this model. Return the number of streams (possibly zero) that
59 * have been assigned.
60 *
61 * \param stream first stream index to use
62 * \return the number of stream indices assigned by this model
63 */
64 virtual int64_t AssignStreams(int64_t stream) = 0;
65
66 private:
67 /**
68 * Attach a phy to the channel
69 * \param phy the phy object to attach
70 */
71 virtual void DoAttach(Ptr<WimaxPhy> phy) = 0;
72
73 /**
74 * Get number of devices on the channel
75 * \returns the number of devices
76 */
77 virtual std::size_t DoGetNDevices() const = 0;
78 /**
79 * Get device corresponding to index
80 * \param i the device index
81 * \returns the device
82 */
83 virtual Ptr<NetDevice> DoGetDevice(std::size_t i) const = 0;
84};
85
86} // namespace ns3
87
88#endif /* WIMAX_CHANNEL_H */
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
The channel object to attach Wimax NetDevices.
std::size_t GetNDevices() const override
static TypeId GetTypeId()
Get the type ID.
virtual std::size_t DoGetNDevices() const =0
Get number of devices on the channel.
virtual int64_t AssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model.
void Attach(Ptr< WimaxPhy > phy)
attach the channel to a physical layer of a device
~WimaxChannel() override
virtual void DoAttach(Ptr< WimaxPhy > phy)=0
Attach a phy to the channel.
virtual Ptr< NetDevice > DoGetDevice(std::size_t i) const =0
Get device corresponding to index.
Ptr< NetDevice > GetDevice(std::size_t i) const override
Every class exported by the ns3 library is enclosed in the ns3 namespace.