A Discrete-Event Network Simulator
API
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
ns3::UanTxModeFactory Class Reference

Global database of UanTxMode objects, retrievable by id or name. More...

#include "uan-tx-mode.h"

Classes

struct  UanTxModeItem
 Container for the UanTxMode properties. More...
 

Public Member Functions

 UanTxModeFactory ()
 Constructor. More...
 
 ~UanTxModeFactory ()
 Destructor. More...
 

Static Public Member Functions

static UanTxMode CreateMode (UanTxMode::ModulationType type, uint32_t dataRateBps, uint32_t phyRateSps, uint32_t cfHz, uint32_t bwHz, uint32_t constSize, std::string name)
 
static UanTxMode GetMode (std::string name)
 Get a mode by name. More...
 
static UanTxMode GetMode (uint32_t uid)
 Get a mode by id. More...
 

Private Member Functions

UanTxModeItemGetModeItem (uint32_t uid)
 Get a mode by id. More...
 
UanTxModeItemGetModeItem (std::string name)
 Get a mode by name. More...
 
UanTxMode MakeModeFromItem (const UanTxModeItem &item)
 Create a public UanTxMode from an internal UanTxModeItem. More...
 
bool NameUsed (std::string name)
 Check if the mode name already exists. More...
 

Static Private Member Functions

static UanTxModeFactoryGetFactory (void)
 Construct and get the static global factory instance. More...
 

Private Attributes

std::map< uint32_t, UanTxModeItemm_modes
 Container for modes. More...
 
uint32_t m_nextUid
 next id number More...
 

Friends

class UanTxMode
 

Detailed Description

Global database of UanTxMode objects, retrievable by id or name.

Definition at line 138 of file uan-tx-mode.h.

Constructor & Destructor Documentation

◆ UanTxModeFactory()

ns3::UanTxModeFactory::UanTxModeFactory ( )

Constructor.

Definition at line 107 of file uan-tx-mode.cc.

◆ ~UanTxModeFactory()

ns3::UanTxModeFactory::~UanTxModeFactory ( )

Destructor.

Definition at line 112 of file uan-tx-mode.cc.

References m_modes.

Member Function Documentation

◆ CreateMode()

UanTxMode ns3::UanTxModeFactory::CreateMode ( UanTxMode::ModulationType  type,
uint32_t  dataRateBps,
uint32_t  phyRateSps,
uint32_t  cfHz,
uint32_t  bwHz,
uint32_t  constSize,
std::string  name 
)
static
Parameters
typeModulation type.
dataRateBpsData rate in BPS.
phyRateSpsSymbol rate in symbols per second.
cfHzCenter frequency in Hz.
bwHzBandwidth in Hz.
constSizeModulation constellation size (2 for BPSK, 4 for QPSK).
nameUnique string name for this transmission mode.
Returns
the transmit mode object

Definition at line 132 of file uan-tx-mode.cc.

References GetFactory(), GetModeItem(), ns3::UanTxModeFactory::UanTxModeItem::m_bwHz, ns3::UanTxModeFactory::UanTxModeItem::m_cfHz, ns3::UanTxModeFactory::UanTxModeItem::m_constSize, ns3::UanTxModeFactory::UanTxModeItem::m_dataRateBps, m_modes, ns3::UanTxModeFactory::UanTxModeItem::m_name, m_nextUid, ns3::UanTxModeFactory::UanTxModeItem::m_phyRateSps, ns3::UanTxModeFactory::UanTxModeItem::m_type, ns3::UanTxModeFactory::UanTxModeItem::m_uid, MakeModeFromItem(), NameUsed(), and NS_LOG_WARN.

Referenced by ns3::UanPhyGen::GetDefaultModes().

◆ GetFactory()

UanTxModeFactory & ns3::UanTxModeFactory::GetFactory ( void  )
staticprivate

◆ GetMode() [1/2]

UanTxMode ns3::UanTxModeFactory::GetMode ( std::string  name)
static

Get a mode by name.

Parameters
nameString name of mode.
Returns
Mode with given name.

Definition at line 194 of file uan-tx-mode.cc.

References GetFactory(), GetModeItem(), and MakeModeFromItem().

◆ GetMode() [2/2]

UanTxMode ns3::UanTxModeFactory::GetMode ( uint32_t  uid)
static

Get a mode by id.

Parameters
uidUnique ID of mode.
Returns
The mode with given uid.

Definition at line 201 of file uan-tx-mode.cc.

References GetFactory(), GetModeItem(), and MakeModeFromItem().

◆ GetModeItem() [1/2]

UanTxModeFactory::UanTxModeItem & ns3::UanTxModeFactory::GetModeItem ( uint32_t  uid)
private

◆ GetModeItem() [2/2]

UanTxModeFactory::UanTxModeItem & ns3::UanTxModeFactory::GetModeItem ( std::string  name)
private

Get a mode by name.

Parameters
nameThe mode name to find.
Returns
The corresponding mode.

Definition at line 179 of file uan-tx-mode.cc.

References m_modes, and NS_FATAL_ERROR.

◆ MakeModeFromItem()

UanTxMode ns3::UanTxModeFactory::MakeModeFromItem ( const UanTxModeItem item)
private

Create a public UanTxMode from an internal UanTxModeItem.

Parameters
itemThe UanTxModeItem to reference.
Returns
A public UanTxMode.

Definition at line 208 of file uan-tx-mode.cc.

References ns3::UanTxMode::m_uid, and ns3::UanTxModeFactory::UanTxModeItem::m_uid.

Referenced by CreateMode(), and GetMode().

◆ NameUsed()

bool ns3::UanTxModeFactory::NameUsed ( std::string  name)
private

Check if the mode name already exists.

Parameters
nameThe mode name to test.
Returns
True if name exists.

Definition at line 117 of file uan-tx-mode.cc.

References m_modes.

Referenced by CreateMode().

Friends And Related Function Documentation

◆ UanTxMode

friend class UanTxMode
friend

Definition at line 180 of file uan-tx-mode.h.

Member Data Documentation

◆ m_modes

std::map<uint32_t, UanTxModeItem> ns3::UanTxModeFactory::m_modes
private

Container for modes.

Internal:
Accessed internally by uid and name, so a multimap might be more appropriate. If name accesses are predominant, perhaps a map indexed by name, with a find for uid. If accesses by uid dominate then vector (since uid's are sequential), and find by name.

Definition at line 208 of file uan-tx-mode.h.

Referenced by CreateMode(), GetModeItem(), NameUsed(), and ~UanTxModeFactory().

◆ m_nextUid

uint32_t ns3::UanTxModeFactory::m_nextUid
private

next id number

Definition at line 181 of file uan-tx-mode.h.

Referenced by CreateMode(), and GetModeItem().


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