A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
wifi-mode.h
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006,2007 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 #ifndef WIFI_MODE_H
21 #define WIFI_MODE_H
22 
23 #include <stdint.h>
24 #include <string>
25 #include <vector>
26 #include <ostream>
27 #include "ns3/attribute-helper.h"
28 #include "ns3/wifi-phy-standard.h"
29 
30 namespace ns3 {
31 
37 {
57 };
58 
59 
68 {
77 };
78 
88 class WifiMode
89 {
90 public:
94  uint32_t GetBandwidth (void) const;
101  uint64_t GetPhyRate (void) const;
105  uint64_t GetDataRate (void) const;
109  enum WifiCodeRate GetCodeRate (void) const;
113  uint8_t GetConstellationSize (void) const;
114 
119  std::string GetUniqueName (void) const;
120 
125  bool IsMandatory (void) const;
126 
134  uint32_t GetUid (void) const;
135 
142 
149  WifiMode ();
150  WifiMode (std::string name);
151 private:
152  friend class WifiModeFactory;
153  WifiMode (uint32_t uid);
154  uint32_t m_uid;
155 };
156 
157 bool operator == (const WifiMode &a, const WifiMode &b);
158 std::ostream & operator << (std::ostream & os, const WifiMode &mode);
159 std::istream & operator >> (std::istream &is, WifiMode &mode);
160 
167 
174 typedef std::vector<WifiMode> WifiModeList;
175 typedef WifiModeList::const_iterator WifiModeListIterator;
176 
184 {
185 public:
203  static WifiMode CreateWifiMode (std::string uniqueName,
204  enum WifiModulationClass modClass,
205  bool isMandatory,
206  uint32_t bandwidth,
207  uint32_t dataRate,
208  enum WifiCodeRate codingRate,
209  uint8_t constellationSize);
210 
211 private:
212  friend class WifiMode;
213  friend std::istream & operator >> (std::istream &is, WifiMode &mode);
214  static WifiModeFactory* GetFactory ();
215  WifiModeFactory ();
216 
223  {
224  std::string uniqueUid;
225  uint32_t bandwidth;
226  uint32_t dataRate;
227  uint32_t phyRate;
228  enum WifiModulationClass modClass;
229  uint8_t constellationSize;
230  enum WifiCodeRate codingRate;
231  bool isMandatory;
232  };
233 
234  WifiMode Search (std::string name);
235  uint32_t AllocateUid (std::string uniqueName);
236  WifiModeItem* Get (uint32_t uid);
237 
238  typedef std::vector<struct WifiModeItem> WifiModeItemList;
239  WifiModeItemList m_itemList;
240 };
241 
242 } // namespace ns3
243 
244 #endif /* WIFI_MODE_H */
std::istream & operator>>(std::istream &is, Angles &a)
Definition: angles.cc:49
WifiCodeRate
Definition: wifi-mode.h:67
enum WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:93
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:88
bool IsMandatory(void) const
Definition: wifi-mode.cc:82
enum WifiCodeRate GetCodeRate(void) const
Definition: wifi-mode.cc:63
std::string GetUniqueName(void) const
Definition: wifi-mode.cc:75
static WifiMode CreateWifiMode(std::string uniqueName, enum WifiModulationClass modClass, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, enum WifiCodeRate codingRate, uint8_t constellationSize)
Definition: wifi-mode.cc:119
uint32_t GetBandwidth(void) const
Definition: wifi-mode.cc:45
#define ATTRIBUTE_HELPER_HEADER(type)
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:43
uint8_t GetConstellationSize(void) const
Definition: wifi-mode.cc:69
uint64_t GetPhyRate(void) const
Definition: wifi-mode.cc:51
std::vector< WifiMode > WifiModeList
Definition: wifi-mode.h:174
create WifiMode class instances and keep track of them.
Definition: wifi-mode.h:183
WifiModulationClass
Definition: wifi-mode.h:36
uint32_t GetUid(void) const
Definition: wifi-mode.cc:88
uint64_t GetDataRate(void) const
Definition: wifi-mode.cc:57