create WifiMode class instances and keep track of them. More...
#include "wifi-mode.h"
Classes | |
struct | WifiModeItem |
This is the data associated to a unique WifiMode. More... | |
Public Types | |
typedef Callback< WifiCodeRate > | CodeRateCallback |
Typedef for callback used to retrieve code rate of a WifiMode. More... | |
typedef Callback< uint16_t > | ConstellationSizeCallback |
Typedef for callback used to retrieve constellation size of a WifiMode. More... | |
typedef Callback< uint64_t, uint16_t, uint16_t, uint8_t > | DataRateCallback |
Typedef for callback used to calculate data rate of a WifiMode. More... | |
typedef Callback< uint64_t, const WifiTxVector &, uint16_t > | DataRateFromTxVectorCallback |
Typedef for callback used to calculate data rate of a WifiMode from a TXVECTOR. More... | |
typedef Callback< bool, uint16_t, uint8_t > | ModeAllowedCallback |
Typedef for callback used to check whether the combination of <current WifiMode, channel width (in MHz), number of stream> is allowed. More... | |
typedef Callback< uint64_t > | NonHtReferenceRateCallback |
Typedef for callback used to calculate Non-HT Reference Rate of an MCS defined in HT or later amendment. More... | |
typedef Callback< uint64_t, uint16_t, uint16_t, uint8_t > | PhyRateCallback |
Typedef for callback used to calculate PHY rate of a WifiMode. More... | |
typedef Callback< uint64_t, const WifiTxVector &, uint16_t > | PhyRateFromTxVectorCallback |
Typedef for callback used to calculate PHY rate of a WifiMode from a TXVECTOR. More... | |
Static Public Member Functions | |
static WifiMode | CreateWifiMcs (std::string uniqueName, uint8_t mcsValue, WifiModulationClass modClass, CodeRateCallback codeRateCallback, ConstellationSizeCallback constellationSizeCallback, PhyRateCallback phyRateCallback, PhyRateFromTxVectorCallback phyRateFromTxVectorCallback, DataRateCallback dataRateCallback, DataRateFromTxVectorCallback dataRateFromTxVectorCallback, NonHtReferenceRateCallback nonHtReferenceRateCallback, ModeAllowedCallback isModeAllowedCallback) |
static WifiMode | CreateWifiMode (std::string uniqueName, WifiModulationClass modClass, bool isMandatory, CodeRateCallback codeRateCallback, ConstellationSizeCallback constellationSizeCallback, PhyRateCallback phyRateCallback, PhyRateFromTxVectorCallback phyRateFromTxVectorCallback, DataRateCallback dataRateCallback, DataRateFromTxVectorCallback dataRateFromTxVectorCallback, ModeAllowedCallback isModeAllowedCallback) |
Private Types | |
typedef std::vector< WifiModeItem > | WifiModeItemList |
typedef for a vector of WifiModeItem. More... | |
Private Member Functions | |
WifiModeFactory () | |
uint32_t | AllocateUid (std::string uniqueUid) |
Allocate a WifiModeItem from a given uniqueUid. More... | |
WifiModeItem * | Get (uint32_t uid) |
Return a WifiModeItem at the given UID index. More... | |
WifiMode | Search (std::string name) const |
Search and return WifiMode from a given name. More... | |
Static Private Member Functions | |
static WifiModeFactory * | GetFactory () |
Return a WifiModeFactory. More... | |
Private Attributes | |
WifiModeItemList | m_itemList |
item list More... | |
Friends | |
std::istream & | operator>> (std::istream &is, WifiMode &mode) |
Serialize WifiMode from istream (human-readable). More... | |
class | WifiMode |
allow WifiMode class access More... | |
create WifiMode class instances and keep track of them.
This factory ensures that each WifiMode created has a unique name and assigns to each of them a unique integer.
Definition at line 266 of file wifi-mode.h.
Typedef for callback used to retrieve code rate of a WifiMode.
Definition at line 274 of file wifi-mode.h.
typedef Callback<uint16_t> ns3::WifiModeFactory::ConstellationSizeCallback |
Typedef for callback used to retrieve constellation size of a WifiMode.
Definition at line 279 of file wifi-mode.h.
typedef Callback<uint64_t, uint16_t , uint16_t , uint8_t > ns3::WifiModeFactory::DataRateCallback |
Typedef for callback used to calculate data rate of a WifiMode.
channelWidth | the channel width in MHz |
guardInterval | the guard interval duration in nanoseconds |
nss | the number of streams |
Definition at line 307 of file wifi-mode.h.
typedef Callback<uint64_t, const WifiTxVector& , uint16_t > ns3::WifiModeFactory::DataRateFromTxVectorCallback |
Typedef for callback used to calculate data rate of a WifiMode from a TXVECTOR.
This is mostly useful in HE or later amendments. For the others it's a simple wrapper of
txVector | the TXVECTOR used for the transmission |
staId | the station ID |
Definition at line 317 of file wifi-mode.h.
typedef Callback<bool, uint16_t , uint8_t > ns3::WifiModeFactory::ModeAllowedCallback |
Typedef for callback used to check whether the combination of <current WifiMode, channel width (in MHz), number of stream> is allowed.
channelWidth | the channel width in MHz |
nss | the number of streams |
Definition at line 334 of file wifi-mode.h.
typedef Callback<uint64_t> ns3::WifiModeFactory::NonHtReferenceRateCallback |
Typedef for callback used to calculate Non-HT Reference Rate of an MCS defined in HT or later amendment.
For Non-HT modes (DSSS, OFDM, etc) this should be defined as null.
Definition at line 325 of file wifi-mode.h.
typedef Callback<uint64_t, uint16_t , uint16_t , uint8_t > ns3::WifiModeFactory::PhyRateCallback |
Typedef for callback used to calculate PHY rate of a WifiMode.
channelWidth | the channel width in MHz |
guardInterval | the guard interval duration in nanoseconds |
nss | the number of streams |
Definition at line 288 of file wifi-mode.h.
typedef Callback<uint64_t, const WifiTxVector& , uint16_t > ns3::WifiModeFactory::PhyRateFromTxVectorCallback |
Typedef for callback used to calculate PHY rate of a WifiMode from a TXVECTOR.
This is mostly useful in HE or later amendments. For the others it's a simple wrapper of
txVector | the TXVECTOR used for the transmission |
staId | the station ID |
Definition at line 298 of file wifi-mode.h.
|
private |
typedef for a vector of WifiModeItem.
Definition at line 477 of file wifi-mode.h.
|
private |
Definition at line 237 of file wifi-mode.cc.
|
private |
Allocate a WifiModeItem from a given uniqueUid.
uniqueUid | the unique UID |
Definition at line 363 of file wifi-mode.cc.
References m_itemList.
Referenced by CreateWifiMcs(), CreateWifiMode(), and GetFactory().
|
static |
uniqueName | the name of the associated WifiMode. This name must be unique across all instances. |
mcsValue | the MCS value |
modClass | the class of modulation |
codeRateCallback | a callback function that returns the coding rate of this WifiMode. |
constellationSizeCallback | a callback function that returns the size of modulation constellation of this WifiMode. |
phyRateCallback | a callback function to calculate the PHY rate (in bps) of this WifiMode. |
phyRateFromTxVectorCallback | a callback function to calculate the PHY rate (in bps) of this WifiMode using a TXVECTOR as input. |
dataRateCallback | a callback function to calculate the data rate (in bps) of this WifiMode. |
dataRateFromTxVectorCallback | a callback function to calculate the data rate (in bps) of this WifiMode using a TXVECTOR as input. |
nonHtReferenceRateCallback | a callback function to calculate the rate (in bps) of the non-HT Reference Rate of this WifiMode. |
isModeAllowedCallback | a callback function to calculate whether a combination of <MCS index, channel width (MHz), number of spatial stream> is allowed for this WifiMode. |
Create a HT or later WifiMode.
Definition at line 291 of file wifi-mode.cc.
References AllocateUid(), Get(), ns3::WifiModeFactory::WifiModeItem::GetCodeRateCallback, ns3::WifiModeFactory::WifiModeItem::GetConstellationSizeCallback, ns3::WifiModeFactory::WifiModeItem::GetDataRateCallback, ns3::WifiModeFactory::WifiModeItem::GetDataRateFromTxVectorCallback, GetFactory(), ns3::WifiModeFactory::WifiModeItem::GetNonHtReferenceRateCallback, ns3::WifiModeFactory::WifiModeItem::GetPhyRateCallback, ns3::WifiModeFactory::WifiModeItem::GetPhyRateFromTxVectorCallback, ns3::WifiModeFactory::WifiModeItem::isMandatory, ns3::WifiModeFactory::WifiModeItem::IsModeAllowedCallback, ns3::WifiModeFactory::WifiModeItem::mcsValue, ns3::WifiModeFactory::WifiModeItem::modClass, NS_ASSERT, ns3::WifiModeFactory::WifiModeItem::uniqueUid, ns3::WIFI_MOD_CLASS_HT, and WifiMode.
Referenced by ns3::HePhy::CreateHeMcs(), ns3::HtPhy::CreateHtMcs(), and ns3::VhtPhy::CreateVhtMcs().
|
static |
uniqueName | the name of the associated WifiMode. This name must be unique across all instances. |
modClass | the class of modulation |
isMandatory | true if this WifiMode is mandatory, false otherwise. |
codeRateCallback | a callback function to retrieve coding rate of this WifiMode. If convolutional coding is used for this rate then the callback returns the convolutional coding rate used. If there is no explicit convolutional coding step (e.g., for DSSS rates) then the callback should returns WIFI_CODE_RATE_UNDEFINED. |
constellationSizeCallback | a callback function that returns the order of the constellation used. |
phyRateCallback | a callback function to calculate the PHY rate (in bps) of this WifiMode. |
phyRateFromTxVectorCallback | a callback function to calculate the PHY rate (in bps) of this WifiMode using a TXVECTOR as input. |
dataRateCallback | a callback function to calculate the data rate (in bps) of this WifiMode. |
dataRateFromTxVectorCallback | a callback function to calculate the data rate (in bps) of this WifiMode using a TXVECTOR as input. |
isModeAllowedCallback | a callback function to check whether a specific combination of this WifiMode, channel width (MHz), and NSS are allowed. |
Create a non-HT WifiMode.
Definition at line 242 of file wifi-mode.cc.
References AllocateUid(), Get(), ns3::WifiModeFactory::WifiModeItem::GetCodeRateCallback, ns3::WifiModeFactory::WifiModeItem::GetConstellationSizeCallback, ns3::WifiModeFactory::WifiModeItem::GetDataRateCallback, ns3::WifiModeFactory::WifiModeItem::GetDataRateFromTxVectorCallback, GetFactory(), ns3::WifiModeFactory::WifiModeItem::GetNonHtReferenceRateCallback, ns3::WifiModeFactory::WifiModeItem::GetPhyRateCallback, ns3::WifiModeFactory::WifiModeItem::GetPhyRateFromTxVectorCallback, ns3::WifiModeFactory::WifiModeItem::isMandatory, ns3::WifiModeFactory::WifiModeItem::IsModeAllowedCallback, ns3::WifiModeFactory::WifiModeItem::mcsValue, ns3::WifiModeFactory::WifiModeItem::modClass, NS_ASSERT, NS_FATAL_ERROR, ns3::WifiModeFactory::WifiModeItem::uniqueUid, ns3::WIFI_CODE_RATE_UNDEFINED, ns3::WIFI_MOD_CLASS_DSSS, ns3::WIFI_MOD_CLASS_HR_DSSS, ns3::WIFI_MOD_CLASS_HT, ns3::WIFI_MOD_CLASS_UNKNOWN, and WifiMode.
Referenced by ns3::DsssPhy::CreateDsssMode(), ns3::ErpOfdmPhy::CreateErpOfdmMode(), and ns3::OfdmPhy::CreateOfdmMode().
|
private |
Return a WifiModeItem at the given UID index.
uid | the UID index |
Definition at line 381 of file wifi-mode.cc.
References m_itemList, and NS_ASSERT.
Referenced by CreateWifiMcs(), CreateWifiMode(), ns3::WifiMode::GetCodeRate(), ns3::WifiMode::GetConstellationSize(), ns3::WifiMode::GetDataRate(), GetFactory(), ns3::WifiMode::GetMcsValue(), ns3::WifiMode::GetModulationClass(), ns3::WifiMode::GetNonHtReferenceRate(), ns3::WifiMode::GetPhyRate(), ns3::WifiMode::GetUniqueName(), ns3::WifiMode::IsAllowed(), and ns3::WifiMode::IsMandatory().
|
staticprivate |
Return a WifiModeFactory.
Definition at line 388 of file wifi-mode.cc.
References AllocateUid(), Get(), ns3::WifiModeFactory::WifiModeItem::GetCodeRateCallback, ns3::WifiModeFactory::WifiModeItem::GetConstellationSizeCallback, ns3::WifiModeFactory::WifiModeItem::GetDataRateCallback, ns3::WifiModeFactory::WifiModeItem::GetDataRateFromTxVectorCallback, ns3::WifiModeFactory::WifiModeItem::GetNonHtReferenceRateCallback, ns3::WifiModeFactory::WifiModeItem::GetPhyRateCallback, ns3::WifiModeFactory::WifiModeItem::GetPhyRateFromTxVectorCallback, ns3::WifiModeFactory::WifiModeItem::isMandatory, ns3::WifiModeFactory::WifiModeItem::IsModeAllowedCallback, ns3::WifiModeFactory::WifiModeItem::mcsValue, ns3::WifiModeFactory::WifiModeItem::modClass, ns3::WifiModeFactory::WifiModeItem::uniqueUid, and ns3::WIFI_MOD_CLASS_UNKNOWN.
Referenced by ns3::WifiMode::WifiMode(), CreateWifiMcs(), CreateWifiMode(), ns3::WifiMode::GetCodeRate(), ns3::WifiMode::GetConstellationSize(), ns3::WifiMode::GetDataRate(), ns3::WifiMode::GetMcsValue(), ns3::WifiMode::GetModulationClass(), ns3::WifiMode::GetNonHtReferenceRate(), ns3::WifiMode::GetPhyRate(), ns3::WifiMode::GetUniqueName(), ns3::WifiMode::IsAllowed(), and ns3::WifiMode::IsMandatory().
|
private |
Search and return WifiMode from a given name.
name | human-readable WifiMode |
Definition at line 328 of file wifi-mode.cc.
References m_itemList, NS_FATAL_ERROR, NS_LOG_UNCOND, and WifiMode.
Referenced by ns3::WifiMode::WifiMode().
|
friend |
Serialize WifiMode from istream (human-readable).
is | the input stream |
mode | the WifiMode |
Definition at line 51 of file wifi-mode.cc.
|
friend |
allow WifiMode class access
Definition at line 417 of file wifi-mode.h.
Referenced by CreateWifiMcs(), CreateWifiMode(), and Search().
|
private |
item list
Definition at line 478 of file wifi-mode.h.
Referenced by AllocateUid(), Get(), and Search().