From 719011058bf7a27ec42de83ad4ecedb37f0d9b8a Mon Sep 17 00:00:00 2001 From: Sebastien Deronne Date: Sat, 30 Apr 2022 11:54:12 +0200 Subject: [PATCH] wifi: Use more const references in WifiPhyStateHelper --- src/wifi/model/wifi-phy-state-helper.cc | 8 +++++--- src/wifi/model/wifi-phy-state-helper.h | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/wifi/model/wifi-phy-state-helper.cc b/src/wifi/model/wifi-phy-state-helper.cc index 41b1b7ed7..372e57858 100644 --- a/src/wifi/model/wifi-phy-state-helper.cc +++ b/src/wifi/model/wifi-phy-state-helper.cc @@ -361,7 +361,7 @@ WifiPhyStateHelper::LogPreviousIdleAndCcaBusyStates (void) } void -WifiPhyStateHelper::SwitchToTx (Time txDuration, WifiConstPsduMap psdus, double txPowerDbm, WifiTxVector txVector) +WifiPhyStateHelper::SwitchToTx (Time txDuration, WifiConstPsduMap psdus, double txPowerDbm, const WifiTxVector& txVector) { NS_LOG_FUNCTION (this << txDuration << psdus << txPowerDbm << txVector); if (!m_txTrace.IsEmpty ()) @@ -456,7 +456,7 @@ WifiPhyStateHelper::SwitchToChannelSwitching (Time switchingDuration) } void -WifiPhyStateHelper::ContinueRxNextMpdu (Ptr psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector) +WifiPhyStateHelper::ContinueRxNextMpdu (Ptr psdu, RxSignalInfo rxSignalInfo, const WifiTxVector& txVector) { NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector); std::vector statusPerMpdu; @@ -467,7 +467,9 @@ WifiPhyStateHelper::ContinueRxNextMpdu (Ptr psdu, RxSignalInfo rxSigna } void -WifiPhyStateHelper::SwitchFromRxEndOk (Ptr psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, uint16_t staId, std::vector statusPerMpdu) +WifiPhyStateHelper::SwitchFromRxEndOk (Ptr psdu, RxSignalInfo rxSignalInfo, + const WifiTxVector& txVector, uint16_t staId, + const std::vector& statusPerMpdu) { NS_LOG_FUNCTION (this << *psdu << rxSignalInfo << txVector << staId << statusPerMpdu.size () << std::all_of(statusPerMpdu.begin(), statusPerMpdu.end(), [](bool v) { return v; })); //returns true if all true diff --git a/src/wifi/model/wifi-phy-state-helper.h b/src/wifi/model/wifi-phy-state-helper.h index 808cabc41..aeaf06e26 100644 --- a/src/wifi/model/wifi-phy-state-helper.h +++ b/src/wifi/model/wifi-phy-state-helper.h @@ -173,7 +173,7 @@ public: * \param txPowerDbm the nominal TX power in dBm * \param txVector the TX vector for the transmission */ - void SwitchToTx (Time txDuration, WifiConstPsduMap psdus, double txPowerDbm, WifiTxVector txVector); + void SwitchToTx (Time txDuration, WifiConstPsduMap psdus, double txPowerDbm, const WifiTxVector& txVector); /** * Switch state to RX for the given duration. * @@ -193,7 +193,7 @@ public: * \param rxSignalInfo the info on the received signal (\see RxSignalInfo) * \param txVector TXVECTOR of the PSDU */ - void ContinueRxNextMpdu (Ptr psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector); + void ContinueRxNextMpdu (Ptr psdu, RxSignalInfo rxSignalInfo, const WifiTxVector& txVector); /** * Switch from RX after the reception was successful. * @@ -203,8 +203,8 @@ public: * \param staId the station ID of the PSDU (only used for MU) * \param statusPerMpdu reception status per MPDU */ - void SwitchFromRxEndOk (Ptr psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, - uint16_t staId, std::vector statusPerMpdu); + void SwitchFromRxEndOk (Ptr psdu, RxSignalInfo rxSignalInfo, const WifiTxVector& txVector, + uint16_t staId, const std::vector& statusPerMpdu); /** * Switch from RX after the reception failed. *