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< bool, const WifiTxVector & > | AllowedCallback |
Typedef for callback used to check whether a given combination is allowed. | |
typedef Callback< WifiCodeRate > | CodeRateCallback |
Typedef for callback used to retrieve code rate of a WifiMode. | |
typedef Callback< uint16_t > | ConstellationSizeCallback |
Typedef for callback used to retrieve constellation size of a WifiMode. | |
typedef Callback< uint64_t, const WifiTxVector &, uint16_t > | DataRateCallback |
Typedef for callback used to calculate data rate of a WifiMode from a TXVECTOR. | |
typedef Callback< uint64_t > | NonHtReferenceRateCallback |
Typedef for callback used to calculate Non-HT Reference Rate of an MCS defined in HT or later amendment. | |
typedef Callback< uint64_t, const WifiTxVector &, uint16_t > | PhyRateCallback |
Typedef for callback used to calculate PHY rate of a WifiMode from a TXVECTOR. | |
Static Public Member Functions | |
static WifiMode | CreateWifiMcs (std::string uniqueName, uint8_t mcsValue, WifiModulationClass modClass, bool isMandatory, CodeRateCallback codeRateCallback, ConstellationSizeCallback constellationSizeCallback, PhyRateCallback phyRateCallback, DataRateCallback dataRateCallback, NonHtReferenceRateCallback nonHtReferenceRateCallback, AllowedCallback isAllowedCallback) |
static WifiMode | CreateWifiMode (std::string uniqueName, WifiModulationClass modClass, bool isMandatory, CodeRateCallback codeRateCallback, ConstellationSizeCallback constellationSizeCallback, PhyRateCallback phyRateCallback, DataRateCallback dataRateCallback, AllowedCallback isAllowedCallback) |
Private Types | |
typedef std::vector< WifiModeItem > | WifiModeItemList |
typedef for a vector of WifiModeItem. | |
Private Member Functions | |
WifiModeFactory () | |
uint32_t | AllocateUid (std::string uniqueUid) |
Allocate a WifiModeItem from a given uniqueUid. | |
WifiModeItem * | Get (uint32_t uid) |
Return a WifiModeItem at the given UID index. | |
WifiMode | Search (std::string name) const |
Search and return WifiMode from a given name. | |
Static Private Member Functions | |
static WifiModeFactory * | GetFactory () |
Return a WifiModeFactory. | |
Private Attributes | |
WifiModeItemList | m_itemList |
item list | |
Friends | |
std::istream & | operator>> (std::istream &is, WifiMode &mode) |
Serialize WifiMode from istream (human-readable). | |
class | WifiMode |
allow WifiMode class access | |
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 263 of file wifi-mode.h.
typedef Callback<bool, const WifiTxVector& > ns3::WifiModeFactory::AllowedCallback |
Typedef for callback used to check whether a given combination is allowed.
txVector | the TXVECTOR containing the combination to check |
Definition at line 311 of file wifi-mode.h.
Typedef for callback used to retrieve code rate of a WifiMode.
Definition at line 271 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 276 of file wifi-mode.h.
typedef Callback<uint64_t, const WifiTxVector& , uint16_t > ns3::WifiModeFactory::DataRateCallback |
Typedef for callback used to calculate data rate of a WifiMode from a TXVECTOR.
txVector | the TXVECTOR used for the transmission |
staId | the station ID |
Definition at line 296 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 304 of file wifi-mode.h.
typedef Callback<uint64_t, const WifiTxVector& , uint16_t > ns3::WifiModeFactory::PhyRateCallback |
Typedef for callback used to calculate PHY rate of a WifiMode from a TXVECTOR.
txVector | the TXVECTOR used for the transmission |
staId | the station ID |
Definition at line 286 of file wifi-mode.h.
|
private |
typedef for a vector of WifiModeItem.
Definition at line 447 of file wifi-mode.h.
|
private |
Definition at line 254 of file wifi-mode.cc.
|
private |
Allocate a WifiModeItem from a given uniqueUid.
uniqueUid | the unique UID |
Definition at line 372 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 |
isMandatory | true if this WifiMode is mandatory, false otherwise. |
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. |
dataRateCallback | a callback function to calculate the data rate (in bps) of this WifiMode. |
nonHtReferenceRateCallback | a callback function to calculate the rate (in bps) of the non-HT Reference Rate of this WifiMode. |
isAllowedCallback | a callback function to calculate whether a given combination of is allowed for this WifiMode. |
Create a HT or later WifiMode.
Definition at line 307 of file wifi-mode.cc.
References AllocateUid(), Get(), ns3::WifiModeFactory::WifiModeItem::GetCodeRateCallback, ns3::WifiModeFactory::WifiModeItem::GetConstellationSizeCallback, ns3::WifiModeFactory::WifiModeItem::GetDataRateCallback, GetFactory(), ns3::WifiModeFactory::WifiModeItem::GetNonHtReferenceRateCallback, ns3::WifiModeFactory::WifiModeItem::GetPhyRateCallback, ns3::WifiModeFactory::WifiModeItem::IsAllowedCallback, ns3::WifiModeFactory::WifiModeItem::isMandatory, ns3::WifiModeFactory::WifiModeItem::mcsValue, ns3::WifiModeFactory::WifiModeItem::modClass, NS_ASSERT, ns3::WifiModeFactory::WifiModeItem::uniqueUid, ns3::WIFI_MOD_CLASS_HT, and WifiMode.
Referenced by ns3::EhtPhy::CreateEhtMcs(), 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. |
dataRateCallback | a callback function to calculate the data rate (in bps) of this WifiMode. |
isAllowedCallback | a callback function to check whether a specific combination of this WifiMode is allowed. |
Create a non-HT WifiMode.
Definition at line 259 of file wifi-mode.cc.
References AllocateUid(), Get(), ns3::WifiModeFactory::WifiModeItem::GetCodeRateCallback, ns3::WifiModeFactory::WifiModeItem::GetConstellationSizeCallback, ns3::WifiModeFactory::WifiModeItem::GetDataRateCallback, GetFactory(), ns3::WifiModeFactory::WifiModeItem::GetNonHtReferenceRateCallback, ns3::WifiModeFactory::WifiModeItem::GetPhyRateCallback, ns3::WifiModeFactory::WifiModeItem::IsAllowedCallback, ns3::WifiModeFactory::WifiModeItem::isMandatory, ns3::MakeNullCallback(), 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 389 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 396 of file wifi-mode.cc.
References AllocateUid(), Get(), ns3::WifiModeFactory::WifiModeItem::GetCodeRateCallback, ns3::WifiModeFactory::WifiModeItem::GetConstellationSizeCallback, ns3::WifiModeFactory::WifiModeItem::GetDataRateCallback, ns3::WifiModeFactory::WifiModeItem::GetNonHtReferenceRateCallback, ns3::WifiModeFactory::WifiModeItem::GetPhyRateCallback, ns3::WifiModeFactory::WifiModeItem::IsAllowedCallback, ns3::WifiModeFactory::WifiModeItem::isMandatory, ns3::MakeNullCallback(), 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 339 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 48 of file wifi-mode.cc.
|
friend |
allow WifiMode class access
Definition at line 381 of file wifi-mode.h.
Referenced by CreateWifiMcs(), CreateWifiMode(), and Search().
|
private |
item list
Definition at line 448 of file wifi-mode.h.
Referenced by AllocateUid(), Get(), and Search().