A Discrete-Event Network Simulator
API
wifi-mac-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2016
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: S├ębastien Deronne <sebastien.deronne@gmail.com>
19  */
20 
21 #ifndef WIFI_MAC_HELPER_H
22 #define WIFI_MAC_HELPER_H
23 
24 #include "ns3/object-factory.h"
25 #include "ns3/wifi-standards.h"
26 
27 namespace ns3 {
28 
29 class WifiMac;
30 class NetDevice;
31 
48 {
49 public:
54  WifiMacHelper ();
58  virtual ~WifiMacHelper ();
59 
68  template <typename... Args>
69  void SetType (std::string type, Args&&... args);
70 
78  template <typename... Args>
79  void SetProtectionManager (std::string type, Args&&... args);
80 
88  template <typename... Args>
89  void SetAckManager (std::string type, Args&&... args);
90 
99  template <typename... Args>
100  void SetMultiUserScheduler (std::string type, Args&&... args);
101 
109  virtual Ptr<WifiMac> Create (Ptr<NetDevice> device, WifiStandard standard) const;
110 
111 
112 protected:
117 };
118 
119 } // namespace ns3
120 
121 
122 /***************************************************************
123  * Implementation of the templates declared above.
124  ***************************************************************/
125 
126 namespace ns3 {
127 
128 template <typename... Args>
129 void
130 WifiMacHelper::SetType (std::string type, Args&&... args)
131 {
132  m_mac.SetTypeId (type);
133  m_mac.Set (args...);
134 }
135 
136 template <typename... Args>
137 void
138 WifiMacHelper::SetProtectionManager (std::string type, Args&&... args)
139 {
141  m_protectionManager.Set (args...);
142 }
143 
144 template <typename... Args>
145 void
146 WifiMacHelper::SetAckManager (std::string type, Args&&... args)
147 {
148  m_ackManager.SetTypeId (type);
149  m_ackManager.Set (args...);
150 }
151 
152 template <typename... Args>
153 void
154 WifiMacHelper::SetMultiUserScheduler (std::string type, Args&&... args)
155 {
156  m_muScheduler.SetTypeId (type);
157  m_muScheduler.Set (args...);
158 }
159 
160 } // namespace ns3
161 
162 #endif /* WIFI_MAC_HELPER_H */
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiMacHelper::m_protectionManager
ObjectFactory m_protectionManager
Factory to create a protection manager.
Definition: wifi-mac-helper.h:114
ns3::WifiMacHelper::SetMultiUserScheduler
void SetMultiUserScheduler(std::string type, Args &&... args)
Helper function used to set the Multi User Scheduler that can be aggregated to an HE AP's MAC.
Definition: wifi-mac-helper.h:154
ns3::WifiMacHelper::SetAckManager
void SetAckManager(std::string type, Args &&... args)
Helper function used to set the Acknowledgment Manager.
Definition: wifi-mac-helper.h:146
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition: object-factory.h:48
ns3::WifiMacHelper::m_muScheduler
ObjectFactory m_muScheduler
Multi-user Scheduler object factory.
Definition: wifi-mac-helper.h:116
ns3::WifiMacHelper::WifiMacHelper
WifiMacHelper()
Create a WifiMacHelper to make life easier for people who want to work with Wifi MAC layers.
Definition: wifi-mac-helper.cc:31
ns3::WifiMacHelper::m_mac
ObjectFactory m_mac
MAC object factory.
Definition: wifi-mac-helper.h:113
ns3::WifiMacHelper::m_ackManager
ObjectFactory m_ackManager
Factory to create an acknowledgment manager.
Definition: wifi-mac-helper.h:115
ns3::WifiMacHelper::SetProtectionManager
void SetProtectionManager(std::string type, Args &&... args)
Helper function used to set the Protection Manager.
Definition: wifi-mac-helper.h:138
ns3::ObjectFactory::Set
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
Definition: object-factory.h:223
ns3::WifiMacHelper::SetType
void SetType(std::string type, Args &&... args)
Definition: wifi-mac-helper.h:130
ns3::ObjectFactory::SetTypeId
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Definition: object-factory.cc:40
ns3::WifiMacHelper
create MAC layers for a ns3::WifiNetDevice.
Definition: wifi-mac-helper.h:48
ns3::WifiStandard
WifiStandard
Identifies the allowed configurations that a Wifi device is configured to use.
Definition: wifi-standards.h:126
ns3::WifiMacHelper::~WifiMacHelper
virtual ~WifiMacHelper()
Destroy a WifiMacHelper.
Definition: wifi-mac-helper.cc:40
ns3::WifiMacHelper::Create
virtual Ptr< WifiMac > Create(Ptr< NetDevice > device, WifiStandard standard) const
Definition: wifi-mac-helper.cc:45