A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::WifiModeFactory Class Reference

create WifiMode class instances and keep track of them. More...

#include "wifi-mode.h"

+ Collaboration diagram for ns3::WifiModeFactory:

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< WifiCodeRateCodeRateCallback
 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< WifiModeItemWifiModeItemList
 typedef for a vector of WifiModeItem.
 

Private Member Functions

 WifiModeFactory ()
 
uint32_t AllocateUid (std::string uniqueUid)
 Allocate a WifiModeItem from a given uniqueUid.
 
WifiModeItemGet (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 WifiModeFactoryGetFactory ()
 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
 

Detailed Description

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.

Member Typedef Documentation

◆ AllowedCallback

Typedef for callback used to check whether a given combination is allowed.

Parameters
txVectorthe TXVECTOR containing the combination to check
Returns
true if combination of current WifiMode and TXVECTOR is allowed.

Definition at line 311 of file wifi-mode.h.

◆ CodeRateCallback

Typedef for callback used to retrieve code rate of a WifiMode.

Returns
the code rate of the WifiMode.

Definition at line 271 of file wifi-mode.h.

◆ ConstellationSizeCallback

Typedef for callback used to retrieve constellation size of a WifiMode.

Returns
the size of modulation constellation of the WifiMode.

Definition at line 276 of file wifi-mode.h.

◆ DataRateCallback

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.

Parameters
txVectorthe TXVECTOR used for the transmission
staIdthe station ID
Returns
the data rate of the signal in bps.

Definition at line 296 of file wifi-mode.h.

◆ 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.

Returns
the rate (in bps) of the non-HT Reference Rate.

Definition at line 304 of file wifi-mode.h.

◆ PhyRateCallback

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.

Parameters
txVectorthe TXVECTOR used for the transmission
staIdthe station ID
Returns
the physical bit rate of the signal in bps.

Definition at line 286 of file wifi-mode.h.

◆ WifiModeItemList

typedef for a vector of WifiModeItem.

Definition at line 447 of file wifi-mode.h.

Constructor & Destructor Documentation

◆ WifiModeFactory()

ns3::WifiModeFactory::WifiModeFactory ( )
private

Definition at line 254 of file wifi-mode.cc.

Member Function Documentation

◆ AllocateUid()

uint32_t ns3::WifiModeFactory::AllocateUid ( std::string uniqueUid)
private

Allocate a WifiModeItem from a given uniqueUid.

Parameters
uniqueUidthe unique UID
Returns
the allocated UID index

Definition at line 372 of file wifi-mode.cc.

References m_itemList.

Referenced by CreateWifiMcs(), CreateWifiMode(), and GetFactory().

+ Here is the caller graph for this function:

◆ CreateWifiMcs()

WifiMode ns3::WifiModeFactory::CreateWifiMcs ( std::string uniqueName,
uint8_t mcsValue,
WifiModulationClass modClass,
bool isMandatory,
CodeRateCallback codeRateCallback,
ConstellationSizeCallback constellationSizeCallback,
PhyRateCallback phyRateCallback,
DataRateCallback dataRateCallback,
NonHtReferenceRateCallback nonHtReferenceRateCallback,
AllowedCallback isAllowedCallback )
static
Parameters
uniqueNamethe name of the associated WifiMode. This name must be unique across all instances.
mcsValuethe MCS value
modClassthe class of modulation
isMandatorytrue if this WifiMode is mandatory, false otherwise.
codeRateCallbacka callback function that returns the coding rate of this WifiMode.
constellationSizeCallbacka callback function that returns the size of modulation constellation of this WifiMode.
phyRateCallbacka callback function to calculate the PHY rate (in bps) of this WifiMode.
dataRateCallbacka callback function to calculate the data rate (in bps) of this WifiMode.
nonHtReferenceRateCallbacka callback function to calculate the rate (in bps) of the non-HT Reference Rate of this WifiMode.
isAllowedCallbacka callback function to calculate whether a given combination of is allowed for this WifiMode.
Returns
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateWifiMode()

WifiMode ns3::WifiModeFactory::CreateWifiMode ( std::string uniqueName,
WifiModulationClass modClass,
bool isMandatory,
CodeRateCallback codeRateCallback,
ConstellationSizeCallback constellationSizeCallback,
PhyRateCallback phyRateCallback,
DataRateCallback dataRateCallback,
AllowedCallback isAllowedCallback )
static
Parameters
uniqueNamethe name of the associated WifiMode. This name must be unique across all instances.
modClassthe class of modulation
isMandatorytrue if this WifiMode is mandatory, false otherwise.
codeRateCallbacka 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.
constellationSizeCallbacka callback function that returns the order of the constellation used.
phyRateCallbacka callback function to calculate the PHY rate (in bps) of this WifiMode.
dataRateCallbacka callback function to calculate the data rate (in bps) of this WifiMode.
isAllowedCallbacka callback function to check whether a specific combination of this WifiMode is allowed.
Returns
WifiMode

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Get()

WifiModeFactory::WifiModeItem * ns3::WifiModeFactory::Get ( uint32_t uid)
private

Return a WifiModeItem at the given UID index.

Parameters
uidthe UID index
Returns
WifiModeItem at the given UID

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().

+ Here is the caller graph for this function:

◆ GetFactory()

◆ Search()

WifiMode ns3::WifiModeFactory::Search ( std::string name) const
private

Search and return WifiMode from a given name.

Parameters
namehuman-readable WifiMode
Returns
the 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().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & is,
WifiMode & mode )
friend

Serialize WifiMode from istream (human-readable).

Parameters
isthe input stream
modethe WifiMode
Returns
std::istream

Definition at line 48 of file wifi-mode.cc.

◆ WifiMode

friend class WifiMode
friend

allow WifiMode class access

Definition at line 381 of file wifi-mode.h.

Referenced by CreateWifiMcs(), CreateWifiMode(), and Search().

Member Data Documentation

◆ m_itemList

WifiModeItemList ns3::WifiModeFactory::m_itemList
private

item list

Definition at line 448 of file wifi-mode.h.

Referenced by AllocateUid(), Get(), and Search().


The documentation for this class was generated from the following files: