A Discrete-Event Network Simulator
API
yans-wifi-helper.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 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_HELPER_H
21 #define YANS_WIFI_HELPER_H
22 
23 #include "wifi-helper.h"
24 
25 #include "ns3/yans-wifi-channel.h"
26 
27 namespace ns3
28 {
29 
39 {
40  public:
46 
55 
70  template <typename... Ts>
71  void AddPropagationLoss(std::string name, Ts&&... args);
79  template <typename... Ts>
80  void SetPropagationDelay(std::string name, Ts&&... args);
81 
88 
101  int64_t AssignStreams(Ptr<YansWifiChannel> c, int64_t stream);
102 
103  private:
104  std::vector<ObjectFactory> m_propagationLoss;
106 };
107 
120 {
121  public:
126 
138  void SetChannel(std::string channelName);
139 
140  private:
148  std::vector<Ptr<WifiPhy>> Create(Ptr<Node> node, Ptr<WifiNetDevice> device) const override;
149 
151 };
152 
153 /***************************************************************
154  * Implementation of the templates declared above.
155  ***************************************************************/
156 
157 template <typename... Ts>
158 void
160 {
161  m_propagationLoss.push_back(ObjectFactory(name, std::forward<Ts>(args)...));
162 }
163 
164 template <typename... Ts>
165 void
167 {
168  m_propagationDelay = ObjectFactory(name, std::forward<Ts>(args)...);
169 }
170 
171 } // namespace ns3
172 
173 #endif /* YANS_WIFI_HELPER_H */
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
create PHY objects
Definition: wifi-helper.h:50
manage and create wifi channel objects for the YANS model.
ObjectFactory m_propagationDelay
propagation delay model
int64_t AssignStreams(Ptr< YansWifiChannel > c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by the channel.
YansWifiChannelHelper()
Create a channel helper without any parameter set.
static YansWifiChannelHelper Default()
Create a channel helper in a default working state.
void SetPropagationDelay(std::string name, Ts &&... args)
void AddPropagationLoss(std::string name, Ts &&... args)
Ptr< YansWifiChannel > Create() const
std::vector< ObjectFactory > m_propagationLoss
vector of propagation loss models
Make it easy to create and manage PHY objects for the YANS model.
Ptr< YansWifiChannel > m_channel
YANS wifi channel.
YansWifiPhyHelper()
Create a PHY helper.
std::vector< Ptr< WifiPhy > > Create(Ptr< Node > node, Ptr< WifiNetDevice > device) const override
void SetChannel(Ptr< YansWifiChannel > channel)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
channel
Definition: third.py:81