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

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

#include "uan-tx-mode.h"

+ Collaboration diagram for ns3::UanTxModeFactory:

Classes

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

Public Member Functions

 UanTxModeFactory ()
 Constructor.
 
 ~UanTxModeFactory ()
 Destructor.
 

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.
 
static UanTxMode GetMode (uint32_t uid)
 Get a mode by id.
 

Private Member Functions

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

Static Private Member Functions

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

Private Attributes

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

Friends

class UanTxMode
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ UanTxModeFactory()

ns3::UanTxModeFactory::UanTxModeFactory ( )

Constructor.

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

◆ ~UanTxModeFactory()

ns3::UanTxModeFactory::~UanTxModeFactory ( )

Destructor.

Definition at line 100 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 121 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 Experiment::CreateMode(), UanTest::DoPhyTests(), and ns3::UanPhyGen::GetDefaultModes().

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

◆ GetFactory()

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

Construct and get the static global factory instance.

Returns
The global instance.

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

Referenced by CreateMode(), ns3::UanTxMode::GetBandwidthHz(), ns3::UanTxMode::GetCenterFreqHz(), ns3::UanTxMode::GetConstellationSize(), ns3::UanTxMode::GetDataRateBps(), GetMode(), GetMode(), ns3::UanTxMode::GetModType(), ns3::UanTxMode::GetName(), and ns3::UanTxMode::GetPhyRateSps().

+ Here is the caller graph for this function:

◆ 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 181 of file uan-tx-mode.cc.

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

+ Here is the call graph for this function:

◆ 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 188 of file uan-tx-mode.cc.

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

+ Here is the call graph for this function:

◆ GetModeItem() [1/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 166 of file uan-tx-mode.cc.

References m_modes, and NS_FATAL_ERROR.

◆ GetModeItem() [2/2]

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

Get a mode by id.

Parameters
uidThe unique id to find.
Returns
The corresponding mode.

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

References m_modes, m_nextUid, and NS_FATAL_ERROR.

Referenced by CreateMode(), ns3::UanTxMode::GetBandwidthHz(), ns3::UanTxMode::GetCenterFreqHz(), ns3::UanTxMode::GetConstellationSize(), ns3::UanTxMode::GetDataRateBps(), GetMode(), GetMode(), ns3::UanTxMode::GetModType(), ns3::UanTxMode::GetName(), and ns3::UanTxMode::GetPhyRateSps().

+ Here is the caller graph for this function:

◆ 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 195 of file uan-tx-mode.cc.

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

Referenced by CreateMode(), GetMode(), and GetMode().

+ Here is the caller graph for this function:

◆ 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 106 of file uan-tx-mode.cc.

References m_modes.

Referenced by CreateMode().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ UanTxMode

friend class UanTxMode
friend

Definition at line 170 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 198 of file uan-tx-mode.h.

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

◆ m_nextUid

uint32_t ns3::UanTxModeFactory::m_nextUid
private

next id number

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

Referenced by CreateMode(), and GetModeItem().


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