A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
wave-helper.h
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License version 2 as
4
* published by the Free Software Foundation;
5
*
6
* This program is distributed in the hope that it will be useful,
7
* but WITHOUT ANY WARRANTY; without even the implied warranty of
8
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
* GNU General Public License for more details.
10
*
11
* You should have received a copy of the GNU General Public License
12
* along with this program; if not, write to the Free Software
13
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14
*
15
* Author: Junling Bu <linlinjavaer@gmail.com>
16
*/
17
18
#ifndef WAVE_HELPER_H
19
#define WAVE_HELPER_H
20
21
#include "ns3/attribute.h"
22
#include "ns3/net-device-container.h"
23
#include "ns3/node-container.h"
24
#include "ns3/object-factory.h"
25
#include "ns3/trace-helper.h"
26
#include "ns3/yans-wifi-helper.h"
27
28
#include <string>
29
30
namespace
ns3
31
{
32
33
class
WaveNetDevice;
34
class
Node;
35
41
class
YansWavePhyHelper
:
public
YansWifiPhyHelper
42
{
43
public
:
48
static
YansWavePhyHelper
Default
();
49
50
private
:
62
void
EnablePcapInternal
(std::string prefix,
63
Ptr<NetDevice>
nd,
64
bool
promiscuous,
65
bool
explicitFilename)
override
;
66
79
void
EnableAsciiInternal
(
Ptr<OutputStreamWrapper>
stream,
80
std::string prefix,
81
Ptr<NetDevice>
nd,
82
bool
explicitFilename)
override
;
83
};
84
115
class
WaveHelper
116
{
117
public
:
118
WaveHelper
();
119
virtual
~WaveHelper
();
120
129
static
WaveHelper
Default
();
130
135
void
CreateMacForChannel
(std::vector<uint32_t> channelNumbers);
139
void
CreatePhys
(
uint32_t
phys);
140
149
template
<
typename
... Ts>
150
void
SetRemoteStationManager
(std::string
type
, Ts&&...
args
);
159
template
<
typename
... Ts>
160
void
SetChannelScheduler
(std::string
type
, Ts&&...
args
);
161
168
virtual
NetDeviceContainer
Install
(
const
WifiPhyHelper
&
phy
,
169
const
WifiMacHelper
&
mac
,
170
NodeContainer
c)
const
;
177
virtual
NetDeviceContainer
Install
(
const
WifiPhyHelper
&
phy
,
178
const
WifiMacHelper
&
mac
,
179
Ptr<Node>
node)
const
;
186
virtual
NetDeviceContainer
Install
(
const
WifiPhyHelper
&
phy
,
187
const
WifiMacHelper
&
mac
,
188
std::string nodeName)
const
;
189
193
static
void
EnableLogComponents
();
194
209
int64_t
AssignStreams
(
NetDeviceContainer
c, int64_t stream);
210
211
protected
:
212
ObjectFactory
m_stationManager
;
213
ObjectFactory
m_channelScheduler
;
214
std::vector<uint32_t>
m_macsForChannelNumber
;
215
uint32_t
m_physNumber
;
216
};
217
218
/***************************************************************
219
* Implementation of the templates declared above.
220
***************************************************************/
221
222
template
<
typename
... Ts>
223
void
224
WaveHelper::SetRemoteStationManager
(std::string
type
, Ts&&...
args
)
225
{
226
m_stationManager
=
ObjectFactory
(
type
, std::forward<Ts>(
args
)...);
227
}
228
229
template
<
typename
... Ts>
230
void
231
WaveHelper::SetChannelScheduler
(std::string
type
, Ts&&...
args
)
232
{
233
m_channelScheduler
=
ObjectFactory
(
type
, std::forward<Ts>(
args
)...);
234
}
235
236
}
// namespace ns3
237
#endif
/* WAVE_HELPER_H */
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition:
net-device-container.h:43
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:40
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition:
object-factory.h:48
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:78
ns3::WaveHelper
helps to create WaveNetDevice objects
Definition:
wave-helper.h:116
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:421
ns3::WaveHelper::~WaveHelper
virtual ~WaveHelper()
Definition:
wave-helper.cc:280
ns3::WaveHelper::m_macsForChannelNumber
std::vector< uint32_t > m_macsForChannelNumber
MACs for channel number.
Definition:
wave-helper.h:214
ns3::WaveHelper::Install
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
Definition:
wave-helper.cc:335
ns3::WaveHelper::EnableLogComponents
static void EnableLogComponents()
Helper to enable all WaveNetDevice log components with one statement.
Definition:
wave-helper.cc:404
ns3::WaveHelper::m_physNumber
uint32_t m_physNumber
Phy number.
Definition:
wave-helper.h:215
ns3::WaveHelper::CreateMacForChannel
void CreateMacForChannel(std::vector< uint32_t > channelNumbers)
Definition:
wave-helper.cc:303
ns3::WaveHelper::WaveHelper
WaveHelper()
Definition:
wave-helper.cc:276
ns3::WaveHelper::SetChannelScheduler
void SetChannelScheduler(std::string type, Ts &&... args)
Definition:
wave-helper.h:231
ns3::WaveHelper::SetRemoteStationManager
void SetRemoteStationManager(std::string type, Ts &&... args)
Definition:
wave-helper.h:224
ns3::WaveHelper::m_channelScheduler
ObjectFactory m_channelScheduler
channel scheduler
Definition:
wave-helper.h:213
ns3::WaveHelper::m_stationManager
ObjectFactory m_stationManager
station manager
Definition:
wave-helper.h:212
ns3::WaveHelper::CreatePhys
void CreatePhys(uint32_t phys)
Definition:
wave-helper.cc:320
ns3::WaveHelper::Default
static WaveHelper Default()
Definition:
wave-helper.cc:285
ns3::WifiMacHelper
create MAC layers for a ns3::WifiNetDevice.
Definition:
wifi-mac-helper.h:48
ns3::WifiPhyHelper
create PHY objects
Definition:
wifi-helper.h:49
ns3::YansWavePhyHelper
To trace WaveNetDevice, we have to overwrite the trace functions of class YansWifiPhyHelper.
Definition:
wave-helper.h:42
ns3::YansWavePhyHelper::EnablePcapInternal
void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename) override
Enable pcap output the indicated net device.
Definition:
wave-helper.cc:130
ns3::YansWavePhyHelper::EnableAsciiInternal
void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename) override
Enable ascii trace output on the indicated net device.
Definition:
wave-helper.cc:180
ns3::YansWavePhyHelper::Default
static YansWavePhyHelper Default()
Create a phy helper in a default working state.
Definition:
wave-helper.cc:122
ns3::YansWifiPhyHelper
Make it easy to create and manage PHY objects for the YANS model.
Definition:
yans-wifi-helper.h:120
uint32_t
check-style-clang-format.args
args
Definition:
check-style-clang-format.py:675
check-style-clang-format.type
type
Definition:
check-style-clang-format.py:657
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
third.mac
mac
Definition:
third.py:85
third.phy
phy
Definition:
third.py:82
src
wave
helper
wave-helper.h
Generated on Fri Mar 17 2023 12:39:39 for ns-3 by
1.9.3