A Discrete-Event Network Simulator
API
he-ru.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2018
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: Stefano Avallone <stavallo@unina.it>
19  */
20 
21 #ifndef HE_RU_H
22 #define HE_RU_H
23 
24 #include <map>
25 #include <vector>
26 
27 #include <cstdint>
28 #include <ostream>
29 namespace ns3 {
30 
31 
35 class HeRu
36 {
37 public:
41  enum RuType
42  {
50  };
51 
53  typedef std::pair<int16_t, int16_t> SubcarrierRange;
54 
56  typedef std::vector<SubcarrierRange> SubcarrierGroup;
57 
58 
64  typedef struct
65  {
66  bool primary80MHz;
68  std::size_t index;
69  } RuSpec;
70 
71 
80  static std::size_t GetNRus (uint8_t bw, RuType ruType);
81 
96  static SubcarrierGroup GetSubcarrierGroup (uint8_t bw, RuType ruType, std::size_t index);
97 
98 #ifdef NOTYET
99 // Currently unused methods planned for ns-3.34; causing
100 // problems with API scanning (see issue #308)
111  static bool DoesOverlap (uint8_t bw, RuSpec ru, const std::vector<RuSpec> &v);
112 
123  static bool DoesOverlap (uint8_t bw, RuSpec ru, const SubcarrierGroup &toneRanges);
124 #endif
125 
132  static uint16_t GetBandwidth (RuType ruType);
133 
145  static RuType GetEqualSizedRusForStations (uint16_t bandwidth, std::size_t& nStations);
146 
148  typedef std::pair<uint8_t, RuType> BwTonesPair;
149 
151  typedef std::map<BwTonesPair, std::vector<SubcarrierGroup> > SubcarrierGroups;
152 
155 };
156 
164 std::ostream& operator<< (std::ostream& os, const HeRu::RuType &ruType);
165 
173 std::ostream& operator<< (std::ostream& os, const HeRu::RuSpec &ru);
174 
175 } //namespace ns3
176 
177 #endif /* HE_RU_H */
RuType ruType
RU type.
Definition: he-ru.h:67
std::vector< SubcarrierRange > SubcarrierGroup
a vector of subcarrier ranges defining a subcarrier group
Definition: he-ru.h:56
bool primary80MHz
true if the RU is allocated in the primary 80MHz channel
Definition: he-ru.h:66
std::pair< int16_t, int16_t > SubcarrierRange
(lowest index, highest index) pair defining a subcarrier range
Definition: he-ru.h:53
std::map< BwTonesPair, std::vector< SubcarrierGroup > > SubcarrierGroups
map (bandwidth, number of tones) pairs to the group of subcarrier ranges
Definition: he-ru.h:151
static uint16_t GetBandwidth(RuType ruType)
Get the approximate bandwidth occupied by a RU.
Definition: he-ru.cc:299
static const SubcarrierGroups m_heRuSubcarrierGroups
Definition: he-ru.h:154
RU Specification.
Definition: he-ru.h:64
static RuType GetEqualSizedRusForStations(uint16_t bandwidth, std::size_t &nStations)
Given the channel bandwidth and the number of stations candidate for being assigned an RU...
Definition: he-ru.cc:324
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
Every class exported by the ns3 library is enclosed in the ns3 namespace.
RuType
The different HE Resource Unit (RU) types.
Definition: he-ru.h:41
static SubcarrierGroup GetSubcarrierGroup(uint8_t bw, RuType ruType, std::size_t index)
Get the subcarrier group of the RU having the given index among all the RUs of the given type (number...
Definition: he-ru.cc:172
std::pair< uint8_t, RuType > BwTonesPair
(bandwidth, number of tones) pair
Definition: he-ru.h:148
This class stores the subcarrier groups of all the available HE RUs.
Definition: he-ru.h:35
std::size_t index
index (starting at 1)
Definition: he-ru.h:68
static std::size_t GetNRus(uint8_t bw, RuType ruType)
Get the number of distinct RUs of the given type (number of tones) available in a HE PPDU of the give...
Definition: he-ru.cc:152