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:
46  static YansWavePhyHelper Default (void);
47 
48 private:
60  virtual void EnablePcapInternal (std::string prefix,
61  Ptr<NetDevice> nd,
62  bool promiscuous,
63  bool explicitFilename);
64 
77  virtual void EnableAsciiInternal (Ptr<OutputStreamWrapper> stream,
78  std::string prefix,
79  Ptr<NetDevice> nd,
80  bool explicitFilename);
81 };
82 
113 {
114 public:
115  WaveHelper ();
116  virtual ~WaveHelper ();
117 
126  static WaveHelper Default (void);
127 
131  void CreateMacForChannel (std::vector<uint32_t> channelNumbers);
135  void CreatePhys (uint32_t phys);
136 
159  void SetRemoteStationManager (std::string type,
160  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
161  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
162  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
163  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
164  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
165  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
166  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
167  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
190  void SetChannelScheduler (std::string type,
191  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
192  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
193  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
194  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
195  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
196  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
197  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
198  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
199 
207  const WifiMacHelper &mac, NodeContainer c) const;
215  const WifiMacHelper &mac, Ptr<Node> node) const;
223  const WifiMacHelper &mac, std::string nodeName) const;
224 
228  static void EnableLogComponents (void);
229 
244  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
245 
246 protected:
249  std::vector<uint32_t> m_macsForChannelNumber;
250  uint32_t m_physNumber;
251 };
252 }
253 #endif /* WAVE_HELPER_H */
static void EnableLogComponents(void)
Helper to enable all WaveNetDevice log components with one statement.
Definition: wave-helper.cc:426
void CreateMacForChannel(std::vector< uint32_t > channelNumbers)
Definition: wave-helper.cc:284
ObjectFactory m_channelScheduler
channel scheduler
Definition: wave-helper.h:248
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:443
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:42
static WaveHelper Default(void)
Definition: wave-helper.cc:269
phy
Definition: third.py:86
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
std::vector< uint32_t > m_macsForChannelNumber
MACs for channel number.
Definition: wave-helper.h:249
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
A class for an empty attribute value.
Definition: attribute.h:232
helps to create WaveNetDevice objects
Definition: wave-helper.h:112
virtual ~WaveHelper()
Definition: wave-helper.cc:264
holds a vector of ns3::NetDevice pointers
mac
Definition: third.py:92
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
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
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:301
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
Definition: wave-helper.cc:361
create MAC layers for a ns3::WifiNetDevice.
To trace WaveNetDevice, we have to overwrite the trace functions of class YansWifiPhyHelper.
Definition: wave-helper.h:40
ObjectFactory m_stationManager
station manager
Definition: wave-helper.h:247
Instantiate subclasses of ns3::Object.
static YansWavePhyHelper Default(void)
Create a phy helper in a default working state.
Definition: wave-helper.cc:123
uint32_t m_physNumber
Phy number.
Definition: wave-helper.h:250