A Discrete-Event Network Simulator
API
infrastructure-wifi-mac.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2017
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 
22 #include "ns3/log.h"
23 
24 namespace ns3 {
25 
26 NS_LOG_COMPONENT_DEFINE ("InfrastructureWifiMac");
27 
28 NS_OBJECT_ENSURE_REGISTERED (InfrastructureWifiMac);
29 
30 
31 TypeId
33 {
34  static TypeId tid = TypeId ("ns3::InfrastructureWifiMac")
36  .SetGroupName ("Wifi")
37  .AddAttribute ("PcfSupported",
38  "This Boolean attribute is set to enable PCF support at this STA",
39  BooleanValue (false),
43  ;
44  return tid;
45 }
46 
48  : m_pcfSupported (0)
49 {
50  NS_LOG_FUNCTION (this);
51 }
52 
54 {
55  NS_LOG_FUNCTION (this);
56 }
57 
58 void
60 {
61  NS_ASSERT_MSG (!(GetPcfSupported () && enable), "QoS cannot be enabled when PCF support is activated (not supported)");
63 }
64 
65 void
67 {
68  NS_LOG_FUNCTION (this << enable);
69  NS_ASSERT_MSG (!(GetQosSupported () && enable), "PCF cannot be enabled when QoS support is activated (not supported)");
70  m_pcfSupported = enable;
71  if (m_stationManager != 0)
72  {
74  }
75 }
76 
77 bool
79 {
80  return m_pcfSupported;
81 }
82 
83 } //namespace ns3
virtual void SetQosSupported(bool enable)
Enable or disable QoS support for the device.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
AttributeValue implementation for Boolean.
Definition: boolean.h:36
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
bool GetQosSupported() const
Return whether the device supports QoS.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: boolean.h:85
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
void SetQosSupported(bool enable)
Enable or disable QoS support for the device.
bool GetPcfSupported() const
Return whether the device supports PCF.
void SetPcfSupported(bool enable)
Enable or disable PCF capability support.
base class for all MAC-level wifi objects.
static TypeId GetTypeId(void)
Get the type ID.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool m_pcfSupported
This Boolean is set true iff this WifiMac support PCF.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:88
void SetPcfSupported(bool enable)
Enable or disable PCF support for the device.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
Ptr< WifiRemoteStationManager > m_stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.)
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923