A Discrete-Event Network Simulator
API
wave-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 as
5  * published by the Free Software Foundation;
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  *
16  * Author: Junling Bu <linlinjavaer@gmail.com>
17  */
18 #ifndef WAVE_HELPER_H
19 #define WAVE_HELPER_H
20 
21 #include <string>
22 #include "ns3/attribute.h"
23 #include "ns3/object-factory.h"
24 #include "ns3/node-container.h"
25 #include "ns3/net-device-container.h"
26 #include "ns3/trace-helper.h"
27 #include "ns3/yans-wifi-helper.h"
28 
29 namespace ns3 {
30 class WifiPhy;
31 class WifiMac;
32 class WaveNetDevice;
33 class Node;
34 
40 {
41 public:
45  static YansWavePhyHelper Default (void);
46 
47 private:
59  virtual void EnablePcapInternal (std::string prefix,
60  Ptr<NetDevice> nd,
61  bool promiscuous,
62  bool explicitFilename);
63 
76  virtual void EnableAsciiInternal (Ptr<OutputStreamWrapper> stream,
77  std::string prefix,
78  Ptr<NetDevice> nd,
79  bool explicitFilename);
80 };
81 
111 {
112 public:
113  WaveHelper ();
114  virtual ~WaveHelper ();
115 
124  static WaveHelper Default (void);
125 
129  void CreateMacForChannel (std::vector<uint32_t> channelNumbers);
133  void CreatePhys (uint32_t phys);
134 
157  void SetRemoteStationManager (std::string type,
158  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
159  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
160  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
161  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
162  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
163  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
164  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
165  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
188  void SetChannelScheduler (std::string type,
189  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
190  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
191  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
192  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
193  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
194  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
195  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
196  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
197 
205  const WifiMacHelper &mac, NodeContainer c) const;
212  virtual NetDeviceContainer Install (const WifiPhyHelper &phy,
213  const WifiMacHelper &mac, Ptr<Node> node) const;
220  virtual NetDeviceContainer Install (const WifiPhyHelper &phy,
221  const WifiMacHelper &mac, std::string nodeName) const;
222 
226  static void EnableLogComponents (void);
227 
242  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
243 
244 protected:
247  std::vector<uint32_t> m_macsForChannelNumber;
248  uint32_t m_physNumber;
249 };
250 }
251 #endif /* WAVE_HELPER_H */
static void EnableLogComponents(void)
Helper to enable all WaveNetDevice log components with one statement.
Definition: wave-helper.cc:395
void CreateMacForChannel(std::vector< uint32_t > channelNumbers)
Definition: wave-helper.cc:253
ObjectFactory m_channelScheduler
Definition: wave-helper.h:246
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by the Phy and Mac aspects ...
Definition: wave-helper.cc:412
Make it easy to create and manage PHY objects for the yans model.
Hold a value for an Attribute.
Definition: attribute.h:68
create PHY objects
Definition: wifi-helper.h:48
static WaveHelper Default(void)
Definition: wave-helper.cc:238
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
Definition: wave-helper.cc:330
void SetRemoteStationManager(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Definition: wave-helper.cc:284
std::vector< uint32_t > m_macsForChannelNumber
Definition: wave-helper.h:247
tuple phy
Definition: third.py:86
virtual void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
Enable pcap output the indicated net device.
Definition: wave-helper.cc:100
A class for an empty attribute value.
Definition: attribute.h:232
helps to create WaveNetDevice objects
Definition: wave-helper.h:110
virtual ~WaveHelper()
Definition: wave-helper.cc:233
holds a vector of ns3::NetDevice pointers
void SetChannelScheduler(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Definition: wave-helper.cc:307
tuple mac
Definition: third.py:92
virtual void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)
Enable ascii trace output on the indicated net device.
Definition: wave-helper.cc:141
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
void CreatePhys(uint32_t phys)
Definition: wave-helper.cc:270
create MAC layers for a ns3::WifiNetDevice.
To trace WaveNetDevice, we have to overwrite the trace functions of class YansWifiPhyHelper.
Definition: wave-helper.h:39
ObjectFactory m_stationManager
Definition: wave-helper.h:245
Instantiate subclasses of ns3::Object.
static YansWavePhyHelper Default(void)
Create a phy helper in a default working state.
Definition: wave-helper.cc:92
uint32_t m_physNumber
Definition: wave-helper.h:248