A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
wifi
helper
wifi-mac-helper.cc
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
#include "
wifi-mac-helper.h
"
22
#include "ns3/wifi-mac.h"
23
#include "ns3/boolean.h"
24
25
namespace
ns3
{
26
27
WifiMacHelper::WifiMacHelper
()
28
{
29
//By default, we create an AdHoc MAC layer without QoS.
30
SetType
(
"ns3::AdhocWifiMac"
,
31
"QosSupported"
,
BooleanValue
(
false
));
32
}
33
34
WifiMacHelper::~WifiMacHelper
()
35
{
36
}
37
38
void
39
WifiMacHelper::SetType
(std::string type,
40
std::string n0,
const
AttributeValue
&v0,
41
std::string n1,
const
AttributeValue
&v1,
42
std::string n2,
const
AttributeValue
&v2,
43
std::string n3,
const
AttributeValue
&v3,
44
std::string n4,
const
AttributeValue
&v4,
45
std::string n5,
const
AttributeValue
&v5,
46
std::string n6,
const
AttributeValue
&v6,
47
std::string n7,
const
AttributeValue
&v7,
48
std::string n8,
const
AttributeValue
&v8,
49
std::string n9,
const
AttributeValue
&v9,
50
std::string n10,
const
AttributeValue
&v10)
51
{
52
m_mac
.
SetTypeId
(type);
53
m_mac
.
Set
(n0, v0);
54
m_mac
.
Set
(n1, v1);
55
m_mac
.
Set
(n2, v2);
56
m_mac
.
Set
(n3, v3);
57
m_mac
.
Set
(n4, v4);
58
m_mac
.
Set
(n5, v5);
59
m_mac
.
Set
(n6, v6);
60
m_mac
.
Set
(n7, v7);
61
m_mac
.
Set
(n8, v8);
62
m_mac
.
Set
(n9, v9);
63
m_mac
.
Set
(n10, v10);
64
}
65
66
Ptr<WifiMac>
67
WifiMacHelper::Create
(
void
)
const
68
{
69
Ptr<WifiMac>
mac
=
m_mac
.
Create
<
WifiMac
> ();
70
return
mac
;
71
}
72
73
}
//namespace ns3
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
ns3::BooleanValue
AttributeValue implementation for Boolean.
Definition:
boolean.h:36
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:68
ns3::ObjectFactory::SetTypeId
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Definition:
object-factory.cc:46
ns3::ObjectFactory::Create
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
Definition:
object-factory.cc:95
ns3::WifiMac
base class for all MAC-level wifi objects.
Definition:
wifi-mac.h:42
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:27
third.mac
mac
Definition:
third.py:92
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiMacHelper::Create
virtual Ptr< WifiMac > Create(void) const
Definition:
wifi-mac-helper.cc:67
wifi-mac-helper.h
ns3::ObjectFactory::Set
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
Definition:
object-factory.cc:64
ns3::WifiMacHelper::SetType
virtual void SetType(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(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue())
Definition:
wifi-mac-helper.cc:39
ns3::WifiMacHelper::~WifiMacHelper
virtual ~WifiMacHelper()
Destroy a WifiMacHelper.
Definition:
wifi-mac-helper.cc:34
ns3::WifiMacHelper::m_mac
ObjectFactory m_mac
MAC object factory.
Definition:
wifi-mac-helper.h:110
Generated on Wed Nov 7 2018 10:02:13 for ns-3 by
1.8.14