A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::WifiMode Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
namestd::string of a valid WifiMode name

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

References ns3::WifiModeFactory::GetFactory(), and ns3::WifiModeFactory::Search().

+ Here is the call graph for this function:

ns3::WifiMode::WifiMode ( uint32_t  uid)
private

Create a WifiMode from a given unique ID.

Parameters
uidunique ID

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

Member Function Documentation

enum WifiCodeRate ns3::WifiMode::GetCodeRate ( void  ) const
Returns
the coding rate of this transmission mode

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8_t ns3::WifiMode::GetConstellationSize ( void  ) const
Returns
the size of the modulation constellation.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint64_t ns3::WifiMode::GetPhyRate ( void  ) const
Returns
the physical bit rate of this signal.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t ns3::WifiMode::GetUid ( void  ) const
Returns
the uid associated to this wireless mode.

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

+ Here is the caller graph for this function:

std::string ns3::WifiMode::GetUniqueName ( void  ) const
Returns
a human-readable representation of this WifiMode instance.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::WifiMode::IsMandatory ( void  ) const
Returns
true if this mode is a mandatory mode, false otherwise.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class WifiModeFactory
friend

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

Member Data Documentation

uint32_t ns3::WifiMode::m_uid
private

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