A Discrete-Event Network Simulator
API
yans-wifi-channel.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2006,2007 INRIA
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Mathieu Lacage, <mathieu.lacage@sophia.inria.fr>
18  */
19 
20 #ifndef YANS_WIFI_CHANNEL_H
21 #define YANS_WIFI_CHANNEL_H
22 
23 #include "ns3/channel.h"
24 
25 namespace ns3
26 {
27 
28 class NetDevice;
29 class PropagationLossModel;
30 class PropagationDelayModel;
31 class YansWifiPhy;
32 class Packet;
33 class Time;
34 class WifiPpdu;
35 
45 class YansWifiChannel : public Channel
46 {
47  public:
52  static TypeId GetTypeId();
53 
55  ~YansWifiChannel() override;
56 
57  std::size_t GetNDevices() const override;
58  Ptr<NetDevice> GetDevice(std::size_t i) const override;
59 
65  void Add(Ptr<YansWifiPhy> phy);
66 
75 
86  void Send(Ptr<YansWifiPhy> sender, Ptr<const WifiPpdu> ppdu, double txPowerDbm) const;
87 
97  int64_t AssignStreams(int64_t stream);
98 
99  private:
103  typedef std::vector<Ptr<YansWifiPhy>> PhyList;
104 
114  static void Receive(Ptr<YansWifiPhy> receiver, Ptr<const WifiPpdu> ppdu, double txPowerDbm);
115 
119 };
120 
121 } // namespace ns3
122 
123 #endif /* YANS_WIFI_CHANNEL_H */
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
a channel to interconnect ns3::YansWifiPhy objects.
void SetPropagationLossModel(const Ptr< PropagationLossModel > loss)
Ptr< PropagationDelayModel > m_delay
Propagation delay model.
static TypeId GetTypeId()
Get the type ID.
std::vector< Ptr< YansWifiPhy > > PhyList
A vector of pointers to YansWifiPhy.
static void Receive(Ptr< YansWifiPhy > receiver, Ptr< const WifiPpdu > ppdu, double txPowerDbm)
This method is scheduled by Send for each associated YansWifiPhy.
void Send(Ptr< YansWifiPhy > sender, Ptr< const WifiPpdu > ppdu, double txPowerDbm) const
Ptr< NetDevice > GetDevice(std::size_t i) const override
PhyList m_phyList
List of YansWifiPhys connected to this YansWifiChannel.
Ptr< PropagationLossModel > m_loss
Propagation loss model.
std::size_t GetNDevices() const override
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
void SetPropagationDelayModel(const Ptr< PropagationDelayModel > delay)
void Add(Ptr< YansWifiPhy > phy)
Adds the given YansWifiPhy to the PHY list.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition: nstime.h:839
Every class exported by the ns3 library is enclosed in the ns3 namespace.
phy
Definition: third.py:89