From 0d12e750e8aabd50b6aabe5f564fc8367aa90526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Tue, 12 Sep 2023 21:18:32 +0200 Subject: [PATCH] wifi: Rename to reflect there might be multiple PHYs handled by helpers --- src/wifi/helper/spectrum-wifi-helper.cc | 8 ++++---- src/wifi/helper/wifi-helper.cc | 6 +++--- src/wifi/helper/wifi-helper.h | 8 ++++---- src/wifi/helper/yans-wifi-helper.cc | 14 +++++++------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/wifi/helper/spectrum-wifi-helper.cc b/src/wifi/helper/spectrum-wifi-helper.cc index 149397101..838af0e55 100644 --- a/src/wifi/helper/spectrum-wifi-helper.cc +++ b/src/wifi/helper/spectrum-wifi-helper.cc @@ -42,8 +42,8 @@ NS_LOG_COMPONENT_DEFINE("SpectrumWifiHelper"); SpectrumWifiPhyHelper::SpectrumWifiPhyHelper(uint8_t nLinks) : WifiPhyHelper(nLinks) { - NS_ABORT_IF(m_phy.size() != nLinks); - for (auto& phy : m_phy) + NS_ABORT_IF(m_phys.size() != nLinks); + for (auto& phy : m_phys) { phy.SetTypeId("ns3::SpectrumWifiPhy"); } @@ -113,9 +113,9 @@ SpectrumWifiPhyHelper::Create(Ptr node, Ptr device) const { std::vector> ret; - for (std::size_t i = 0; i < m_phy.size(); i++) + for (std::size_t i = 0; i < m_phys.size(); i++) { - Ptr phy = m_phy.at(i).Create(); + auto phy = m_phys.at(i).Create(); auto interference = m_interferenceHelper.Create(); phy->SetInterferenceHelper(interference); Ptr error = m_errorRateModel.at(i).Create(); diff --git a/src/wifi/helper/wifi-helper.cc b/src/wifi/helper/wifi-helper.cc index 32e3a0648..99611e2b5 100644 --- a/src/wifi/helper/wifi-helper.cc +++ b/src/wifi/helper/wifi-helper.cc @@ -147,7 +147,7 @@ WifiPhyHelper::WifiPhyHelper(uint8_t nLinks) : m_pcapDlt(PcapHelper::DLT_IEEE802_11) { NS_ABORT_IF(nLinks == 0); - m_phy.resize(nLinks); + m_phys.resize(nLinks); m_errorRateModel.resize(nLinks); m_frameCaptureModel.resize(nLinks); m_preambleDetectionModel.resize(nLinks); @@ -162,7 +162,7 @@ WifiPhyHelper::~WifiPhyHelper() void WifiPhyHelper::Set(std::string name, const AttributeValue& v) { - for (auto& phy : m_phy) + for (auto& phy : m_phys) { phy.Set(name, v); } @@ -171,7 +171,7 @@ WifiPhyHelper::Set(std::string name, const AttributeValue& v) void WifiPhyHelper::Set(uint8_t linkId, std::string name, const AttributeValue& v) { - m_phy.at(linkId).Set(name, v); + m_phys.at(linkId).Set(name, v); } void diff --git a/src/wifi/helper/wifi-helper.h b/src/wifi/helper/wifi-helper.h index b934ee0dd..7a9ccec6c 100644 --- a/src/wifi/helper/wifi-helper.h +++ b/src/wifi/helper/wifi-helper.h @@ -235,7 +235,7 @@ class WifiPhyHelper : public PcapHelperForDevice, public AsciiTraceHelperForDevi SignalNoiseDbm signalNoise, uint16_t staId = SU_STA_ID); - std::vector m_phy; ///< PHY object + std::vector m_phys; ///< PHY objects ObjectFactory m_interferenceHelper; ///< interference helper std::vector m_errorRateModel; ///< error rate model std::vector m_frameCaptureModel; ///< frame capture model @@ -549,7 +549,7 @@ template void WifiPhyHelper::SetErrorRateModel(std::string type, Args&&... args) { - for (std::size_t linkId = 0; linkId < m_phy.size(); linkId++) + for (std::size_t linkId = 0; linkId < m_phys.size(); linkId++) { SetErrorRateModel(linkId, type, std::forward(args)...); } @@ -567,7 +567,7 @@ template void WifiPhyHelper::SetFrameCaptureModel(std::string type, Args&&... args) { - for (std::size_t linkId = 0; linkId < m_phy.size(); linkId++) + for (std::size_t linkId = 0; linkId < m_phys.size(); linkId++) { SetFrameCaptureModel(linkId, type, std::forward(args)...); } @@ -585,7 +585,7 @@ template void WifiPhyHelper::SetPreambleDetectionModel(std::string type, Args&&... args) { - for (std::size_t linkId = 0; linkId < m_phy.size(); linkId++) + for (std::size_t linkId = 0; linkId < m_phys.size(); linkId++) { SetPreambleDetectionModel(linkId, type, std::forward(args)...); } diff --git a/src/wifi/helper/yans-wifi-helper.cc b/src/wifi/helper/yans-wifi-helper.cc index 5429fd02f..4f677f0c8 100644 --- a/src/wifi/helper/yans-wifi-helper.cc +++ b/src/wifi/helper/yans-wifi-helper.cc @@ -82,7 +82,7 @@ YansWifiPhyHelper::YansWifiPhyHelper() : WifiPhyHelper(1), // YANS phy is not used for 11be devices m_channel(nullptr) { - m_phy.at(0).SetTypeId("ns3::YansWifiPhy"); + m_phys.front().SetTypeId("ns3::YansWifiPhy"); SetInterferenceHelper("ns3::InterferenceHelper"); SetErrorRateModel("ns3::TableBasedErrorRateModel"); } @@ -103,19 +103,19 @@ YansWifiPhyHelper::SetChannel(std::string channelName) std::vector> YansWifiPhyHelper::Create(Ptr node, Ptr device) const { - Ptr phy = m_phy.at(0).Create(); + Ptr phy = m_phys.front().Create(); Ptr interference = m_interferenceHelper.Create(); phy->SetInterferenceHelper(interference); - Ptr error = m_errorRateModel.at(0).Create(); + Ptr error = m_errorRateModel.front().Create(); phy->SetErrorRateModel(error); - if (m_frameCaptureModel.at(0).IsTypeIdSet()) + if (m_frameCaptureModel.front().IsTypeIdSet()) { - auto frameCapture = m_frameCaptureModel.at(0).Create(); + auto frameCapture = m_frameCaptureModel.front().Create(); phy->SetFrameCaptureModel(frameCapture); } - if (m_preambleDetectionModel.at(0).IsTypeIdSet()) + if (m_preambleDetectionModel.front().IsTypeIdSet()) { - auto preambleDetection = m_preambleDetectionModel.at(0).Create(); + auto preambleDetection = m_preambleDetectionModel.front().Create(); phy->SetPreambleDetectionModel(preambleDetection); } phy->SetChannel(m_channel);