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 
19 #ifndef WAVE_HELPER_H
20 #define WAVE_HELPER_H
21 
22 #include <string>
23 #include "ns3/attribute.h"
24 #include "ns3/object-factory.h"
25 #include "ns3/node-container.h"
26 #include "ns3/net-device-container.h"
27 #include "ns3/trace-helper.h"
28 #include "ns3/yans-wifi-helper.h"
29 
30 namespace ns3 {
31 
32 class WaveNetDevice;
33 class Node;
34 
41 {
42 public:
47  static YansWavePhyHelper Default (void);
48 
49 private:
61  virtual void EnablePcapInternal (std::string prefix,
62  Ptr<NetDevice> nd,
63  bool promiscuous,
64  bool explicitFilename);
65 
78  virtual void EnableAsciiInternal (Ptr<OutputStreamWrapper> stream,
79  std::string prefix,
80  Ptr<NetDevice> nd,
81  bool explicitFilename);
82 };
83 
114 {
115 public:
116  WaveHelper ();
117  virtual ~WaveHelper ();
118 
127  static WaveHelper Default (void);
128 
132  void CreateMacForChannel (std::vector<uint32_t> channelNumbers);
136  void CreatePhys (uint32_t phys);
137 
160  void SetRemoteStationManager (std::string type,
161  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
162  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
163  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
164  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
165  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
166  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
167  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
168  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
191  void SetChannelScheduler (std::string type,
192  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
193  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
194  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
195  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
196  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
197  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
198  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
199  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
200 
208  const WifiMacHelper &mac, NodeContainer c) const;
216  const WifiMacHelper &mac, Ptr<Node> node) const;
224  const WifiMacHelper &mac, std::string nodeName) const;
225 
229  static void EnableLogComponents (void);
230 
245  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
246 
247 protected:
250  std::vector<uint32_t> m_macsForChannelNumber;
251  uint32_t m_physNumber;
252 };
253 }
254 #endif /* WAVE_HELPER_H */
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition: net-device-container.h:42
ns3::YansWifiPhyHelper
Make it easy to create and manage PHY objects for the YANS model.
Definition: yans-wifi-helper.h:161
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WaveHelper::Default
static WaveHelper Default(void)
Definition: wave-helper.cc:269
ns3::WaveHelper::CreateMacForChannel
void CreateMacForChannel(std::vector< uint32_t > channelNumbers)
Definition: wave-helper.cc:284
ns3::WaveHelper::EnableLogComponents
static void EnableLogComponents(void)
Helper to enable all WaveNetDevice log components with one statement.
Definition: wave-helper.cc:424
ns3::AttributeValue
Hold a value for an Attribute.
Definition: attribute.h:69
ns3::WaveHelper::CreatePhys
void CreatePhys(uint32_t phys)
Definition: wave-helper.cc:301
third.mac
mac
Definition: third.py:99
ns3::WaveHelper
helps to create WaveNetDevice objects
Definition: wave-helper.h:114
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::YansWavePhyHelper::EnableAsciiInternal
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:172
ns3::YansWavePhyHelper::EnablePcapInternal
virtual void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
Enable pcap output the indicated net device.
Definition: wave-helper.cc:131
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition: object-factory.h:48
ns3::WaveHelper::AssignStreams
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:441
ns3::WaveHelper::WaveHelper
WaveHelper()
Definition: wave-helper.cc:260
ns3::YansWavePhyHelper
To trace WaveNetDevice, we have to overwrite the trace functions of class YansWifiPhyHelper.
Definition: wave-helper.h:41
ns3::WaveHelper::~WaveHelper
virtual ~WaveHelper()
Definition: wave-helper.cc:264
ns3::WaveHelper::m_stationManager
ObjectFactory m_stationManager
station manager
Definition: wave-helper.h:248
ns3::EmptyAttributeValue
A class for an empty attribute value.
Definition: attribute.h:233
ns3::WifiPhyHelper
create PHY objects
Definition: wifi-helper.h:48
ns3::YansWavePhyHelper::Default
static YansWavePhyHelper Default(void)
Create a phy helper in a default working state.
Definition: wave-helper.cc:123
ns3::WaveHelper::SetChannelScheduler
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:338
ns3::WaveHelper::SetRemoteStationManager
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:315
ns3::NodeContainer
keep track of a set of node pointers.
Definition: node-container.h:39
ns3::WaveHelper::m_channelScheduler
ObjectFactory m_channelScheduler
channel scheduler
Definition: wave-helper.h:249
ns3::WifiMacHelper
create MAC layers for a ns3::WifiNetDevice.
Definition: wifi-mac-helper.h:48
ns3::WaveHelper::m_physNumber
uint32_t m_physNumber
Phy number.
Definition: wave-helper.h:251
third.phy
phy
Definition: third.py:93
ns3::WaveHelper::m_macsForChannelNumber
std::vector< uint32_t > m_macsForChannelNumber
MACs for channel number.
Definition: wave-helper.h:250
ns3::WaveHelper::Install
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
Definition: wave-helper.cc:361