A Discrete-Event Network Simulator
API
wave-mac-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 INRIA
3 * Copyright (c) 2009 MIRKO BANCHI
4 * Copyright (c) 2013 Dalian University of Technology
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation;
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20 * Author: Mirko Banchi <mk.banchi@gmail.com>
21 * Author: Junling Bu <linlinjavaer@gmail.com>
22 */
23#ifndef WAVE_MAC_HELPER_H
24#define WAVE_MAC_HELPER_H
25#include "ns3/wifi-mac-helper.h"
26
27namespace ns3
28{
29
35{
36 public:
42
46 ~NqosWaveMacHelper() override;
64 template <typename... Ts>
65 void SetType(std::string type, Ts&&... args);
66};
67
73{
74 public:
80
84 ~QosWaveMacHelper() override;
85
91
103 template <typename... Ts>
104 void SetType(std::string type, Ts&&... args);
105};
106
107/***************************************************************
108 * Implementation of the templates declared above.
109 ***************************************************************/
110
111template <typename... Ts>
112void
114{
115 if (type != "ns3::OcbWifiMac")
116 {
117 NS_FATAL_ERROR("QosWaveMacHelper shall set OcbWifiMac");
118 }
119 WifiMacHelper::SetType("ns3::OcbWifiMac", std::forward<Ts>(args)...);
120}
121
122template <typename... Ts>
123void
125{
126 if (type != "ns3::OcbWifiMac")
127 {
128 NS_FATAL_ERROR("QosWaveMacHelper shall set OcbWifiMac");
129 }
130 WifiMacHelper::SetType("ns3::OcbWifiMac", std::forward<Ts>(args)...);
131}
132
133} // namespace ns3
134
135#endif /* WAVE_MAC_HELPER_H */
Nqos Wave Mac Helper class.
void SetType(std::string type, Ts &&... args)
static NqosWaveMacHelper Default()
Create a mac helper in a default working state.
~NqosWaveMacHelper() override
Destroy a NqosWaveMacHelper.
NqosWaveMacHelper()
Create a NqosWaveMacHelper to make life easier for people who want to work with non-QOS Wave MAC laye...
Qos Wave Mac Helper class.
QosWaveMacHelper()
Create a QosWaveMacHelper that is used to make life easier when working with Wifi 802....
static QosWaveMacHelper Default()
Create a mac helper in a default working state.
~QosWaveMacHelper() override
Destroy a QosWaveMacHelper.
void SetType(std::string type, Ts &&... args)
create MAC layers for a ns3::WifiNetDevice.
void SetType(std::string type, Args &&... args)
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:179
Every class exported by the ns3 library is enclosed in the ns3 namespace.