represent a single transmission modeA WifiMode is implemented by a single integer which is used to lookup in a global array the characteristics of the associated transmission mode. More...
#include <wifi-mode.h>
Public Member Functions | |
WifiMode () | |
Create an invalid WifiMode. More... | |
WifiMode (std::string name) | |
Create a WifiMode if the given string represents a valid WifiMode name. More... | |
uint32_t | GetBandwidth (void) const |
enum WifiCodeRate | GetCodeRate (void) const |
uint8_t | GetConstellationSize (void) const |
uint64_t | GetDataRate (void) const |
enum WifiModulationClass | GetModulationClass () const |
uint64_t | GetPhyRate (void) const |
uint32_t | GetUid (void) const |
std::string | GetUniqueName (void) const |
bool | IsMandatory (void) const |
Private Member Functions | |
WifiMode (uint32_t uid) | |
Create a WifiMode from a given unique ID. More... | |
Private Attributes | |
uint32_t | m_uid |
Friends | |
class | WifiModeFactory |
represent a single transmission mode
A WifiMode is implemented by a single integer which is used to lookup in a global array the characteristics of the associated transmission mode.
It is thus extremely cheap to keep a WifiMode variable around.
Definition at line 91 of file wifi-mode.h.
ns3::WifiMode::WifiMode | ( | ) |
Create an invalid WifiMode.
Calling any method on the instance created will trigger an assert. This is useful to separate the declaration of a WifiMode variable from its initialization.
Definition at line 120 of file wifi-mode.cc.
ns3::WifiMode::WifiMode | ( | std::string | name | ) |
Create a WifiMode if the given string represents a valid WifiMode name.
name | std::string of a valid WifiMode name |
Definition at line 128 of file wifi-mode.cc.
References ns3::WifiModeFactory::GetFactory(), and ns3::WifiModeFactory::Search().
|
private |
Create a WifiMode from a given unique ID.
uid | unique ID |
Definition at line 124 of file wifi-mode.cc.
uint32_t ns3::WifiMode::GetBandwidth | ( | void | ) | const |
Definition at line 67 of file wifi-mode.cc.
References ns3::WifiModeFactory::WifiModeItem::bandwidth, ns3::WifiModeFactory::Get(), ns3::WifiModeFactory::GetFactory(), and m_uid.
Referenced by ns3::InterferenceHelper::CalculateSnr(), ns3::YansErrorRateModel::GetChunkSuccessRate(), ns3::WifiPhy::GetMFPlcpHeaderMode(), ns3::WifiPhy::GetPayloadDurationMicroSeconds(), ns3::WifiPhy::GetPlcpHeaderDurationMicroSeconds(), ns3::WifiPhy::GetPlcpHeaderMode(), and ns3::WifiPhy::GetPlcpPreambleDurationMicroSeconds().
enum WifiCodeRate ns3::WifiMode::GetCodeRate | ( | void | ) | const |
Definition at line 85 of file wifi-mode.cc.
References ns3::WifiModeFactory::WifiModeItem::codingRate, ns3::WifiModeFactory::Get(), ns3::WifiModeFactory::GetFactory(), and m_uid.
Referenced by ns3::NistErrorRateModel::GetChunkSuccessRate(), and ns3::YansErrorRateModel::GetChunkSuccessRate().
uint8_t ns3::WifiMode::GetConstellationSize | ( | void | ) | const |
Definition at line 91 of file wifi-mode.cc.
References ns3::WifiModeFactory::WifiModeItem::constellationSize, ns3::WifiModeFactory::Get(), ns3::WifiModeFactory::GetFactory(), and m_uid.
Referenced by ns3::NistErrorRateModel::GetChunkSuccessRate(), and ns3::YansErrorRateModel::GetChunkSuccessRate().
uint64_t ns3::WifiMode::GetDataRate | ( | void | ) | const |
Definition at line 79 of file wifi-mode.cc.
References ns3::WifiModeFactory::WifiModeItem::dataRate, ns3::WifiModeFactory::Get(), ns3::WifiModeFactory::GetFactory(), and m_uid.
Referenced by ns3::MeshWifiInterfaceMac::CheckSupportedRates(), ns3::NistErrorRateModel::GetChunkSuccessRate(), ns3::YansErrorRateModel::GetChunkSuccessRate(), ns3::WaveMacLow::GetDataTxVector(), ns3::WifiPhy::GetPayloadDurationMicroSeconds(), ns3::MeshWifiInterfaceMac::GetSupportedRates(), ns3::StaWifiMac::GetSupportedRates(), ns3::ApWifiMac::GetSupportedRates(), ns3::ApWifiMac::Receive(), ns3::StaWifiMac::Receive(), ns3::MeshWifiInterfaceMac::Receive(), ns3::YansWifiPhy::SendPacket(), and ns3::YansWifiPhy::WifiModeToMcs().
enum WifiModulationClass ns3::WifiMode::GetModulationClass | ( | ) | const |
Definition at line 115 of file wifi-mode.cc.
References ns3::WifiModeFactory::Get(), ns3::WifiModeFactory::GetFactory(), m_uid, and ns3::WifiModeFactory::WifiModeItem::modClass.
Referenced by ns3::MacLow::CalculateOverallTxTime(), ns3::MacLow::CalculateTransmissionTime(), ns3::MacLow::GetAckDuration(), ns3::MacLow::GetBlockAckDuration(), ns3::NistErrorRateModel::GetChunkSuccessRate(), ns3::YansErrorRateModel::GetChunkSuccessRate(), ns3::WifiRemoteStationManager::GetControlAnswerMode(), ns3::MacLow::GetCtsDuration(), ns3::WifiPhy::GetPayloadDurationMicroSeconds(), ns3::WifiPhy::GetPlcpHeaderDurationMicroSeconds(), ns3::WifiPhy::GetPlcpHeaderMode(), ns3::WifiPhy::GetPlcpPreambleDurationMicroSeconds(), ns3::MacLow::SendAckAfterData(), ns3::MacLow::SendBlockAckResponse(), ns3::MacLow::SendCtsAfterRts(), ns3::MacLow::SendCtsToSelf(), ns3::MacLow::SendDataAfterCts(), ns3::MacLow::SendDataPacket(), ns3::MacLow::SendRtsForPacket(), and ns3::MacLow::StartDataTxTimers().
uint64_t ns3::WifiMode::GetPhyRate | ( | void | ) | const |
If a transmission mode uses 1/2 FEC, and if its data rate is 3Mbs, the phy rate is 6Mbs
Definition at line 73 of file wifi-mode.cc.
References ns3::WifiModeFactory::Get(), ns3::WifiModeFactory::GetFactory(), m_uid, and ns3::WifiModeFactory::WifiModeItem::phyRate.
Referenced by ns3::InterferenceHelper::CalculateChunkSuccessRate(), ns3::YansErrorRateModel::GetChunkSuccessRate(), and ns3::WifiRemoteStationManager::GetControlAnswerMode().
uint32_t ns3::WifiMode::GetUid | ( | void | ) | const |
Each specific wireless mode should have a different uid. For example, the 802.11b 1Mbs and the 802.11b 2Mbs modes should have different uids.
Definition at line 110 of file wifi-mode.cc.
References m_uid.
Referenced by ns3::operator==().
std::string ns3::WifiMode::GetUniqueName | ( | void | ) | const |
Definition at line 97 of file wifi-mode.cc.
References ns3::WifiModeFactory::Get(), ns3::WifiModeFactory::GetFactory(), m_uid, and ns3::WifiModeFactory::WifiModeItem::uniqueUid.
Referenced by ns3::WifiPhy::GetPayloadDurationMicroSeconds(), ns3::operator<<(), and ns3::YansWifiPhy::WifiModeToMcs().
bool ns3::WifiMode::IsMandatory | ( | void | ) | const |
Definition at line 104 of file wifi-mode.cc.
References ns3::WifiModeFactory::Get(), ns3::WifiModeFactory::GetFactory(), ns3::WifiModeFactory::WifiModeItem::isMandatory, and m_uid.
Referenced by ns3::WifiRemoteStationManager::GetControlAnswerMode(), and ns3::WifiRemoteStationManager::Reset().
|
friend |
Definition at line 161 of file wifi-mode.h.
|
private |
Definition at line 168 of file wifi-mode.h.
Referenced by GetBandwidth(), GetCodeRate(), GetConstellationSize(), GetDataRate(), GetModulationClass(), GetPhyRate(), GetUid(), GetUniqueName(), and IsMandatory().