A Discrete-Event Network Simulator
API
wifi-mac-queue-scheduler.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 Universita' degli Studi di Napoli Federico II
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Stefano Avallone <stavallo@unina.it>
18  */
19 
20 #ifndef WIFI_MAC_QUEUE_SCHEDULER_H
21 #define WIFI_MAC_QUEUE_SCHEDULER_H
22 
23 #include "qos-utils.h"
25 
26 #include "ns3/object.h"
27 
28 #include <optional>
29 
30 namespace ns3
31 {
32 
33 class WifiMpdu;
34 class WifiMac;
35 
43 {
44  public:
49  static TypeId GetTypeId();
50 
56  virtual void SetWifiMac(Ptr<WifiMac> mac);
57 
67  virtual std::optional<WifiContainerQueueId> GetNext(AcIndex ac, uint8_t linkId) = 0;
78  virtual std::optional<WifiContainerQueueId> GetNext(
79  AcIndex ac,
80  uint8_t linkId,
81  const WifiContainerQueueId& prevQueueId) = 0;
82 
91  virtual std::list<uint8_t> GetLinkIds(AcIndex ac, const WifiContainerQueueId& queueId) = 0;
100  virtual void SetLinkIds(AcIndex ac,
101  const WifiContainerQueueId& queueId,
102  const std::list<uint8_t>& linkIds) = 0;
103 
120  virtual void NotifyEnqueue(AcIndex ac, Ptr<WifiMpdu> mpdu) = 0;
129  virtual void NotifyDequeue(AcIndex ac, const std::list<Ptr<WifiMpdu>>& mpdus) = 0;
138  virtual void NotifyRemove(AcIndex ac, const std::list<Ptr<WifiMpdu>>& mpdus) = 0;
139 
140  protected:
141  void DoDispose() override;
142 
148  Ptr<WifiMac> GetMac() const;
149 
150  private:
152 };
153 
154 } // namespace ns3
155 
156 #endif /* WIFI_MAC_QUEUE_SCHEDULER_H */
A base class which provides memory management and object aggregation.
Definition: object.h:89
a unique identifier for an interface.
Definition: type-id.h:60
WifiMacQueueScheduler is an abstract base class defining the public interface for a wifi MAC queue sc...
virtual void SetWifiMac(Ptr< WifiMac > mac)
Set the wifi MAC.
Ptr< WifiMac > GetMac() const
Get the wifi MAC.
virtual std::optional< WifiContainerQueueId > GetNext(AcIndex ac, uint8_t linkId, const WifiContainerQueueId &prevQueueId)=0
Get the next queue to serve after the given one.
virtual void SetLinkIds(AcIndex ac, const WifiContainerQueueId &queueId, const std::list< uint8_t > &linkIds)=0
Set the list of the IDs of the links the given container queue (belonging to the given Access Categor...
virtual std::optional< WifiContainerQueueId > GetNext(AcIndex ac, uint8_t linkId)=0
Get the next queue to serve, which is guaranteed to contain at least an MPDU whose lifetime has not e...
virtual Ptr< WifiMpdu > HasToDropBeforeEnqueue(AcIndex ac, Ptr< WifiMpdu > mpdu)=0
Check whether an MPDU has to be dropped before enqueuing the given MPDU.
virtual void NotifyDequeue(AcIndex ac, const std::list< Ptr< WifiMpdu >> &mpdus)=0
Notify the scheduler that the given list of MPDUs have been dequeued by the given Access Category.
virtual std::list< uint8_t > GetLinkIds(AcIndex ac, const WifiContainerQueueId &queueId)=0
Get the list of the IDs of the links the given container queue (belonging to the given Access Categor...
virtual void NotifyEnqueue(AcIndex ac, Ptr< WifiMpdu > mpdu)=0
Notify the scheduler that the given MPDU has been enqueued by the given Access Category.
void DoDispose() override
Destructor implementation.
static TypeId GetTypeId()
Get the type ID.
Ptr< WifiMac > m_mac
MAC layer.
virtual void NotifyRemove(AcIndex ac, const std::list< Ptr< WifiMpdu >> &mpdus)=0
Notify the scheduler that the given list of MPDUs have been removed by the given Access Category.
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:72
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::tuple< WifiContainerQueueType, Mac48Address, std::optional< uint8_t > > WifiContainerQueueId
Tuple (queue type, Address, TID) identifying a container queue.
mac
Definition: third.py:85
#define list