From f00a05715526ffa949200b80ba7a9eef1e590929 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Fri, 21 May 2021 20:21:41 +0200 Subject: [PATCH] wifi: WifiTxTimer::FeedTraceSource methods do not need to be template class members --- src/wifi/model/wifi-tx-timer.cc | 14 ++---- src/wifi/model/wifi-tx-timer.h | 82 ++++++++++----------------------- 2 files changed, 29 insertions(+), 67 deletions(-) diff --git a/src/wifi/model/wifi-tx-timer.cc b/src/wifi/model/wifi-tx-timer.cc index bd4f77ca0..fea1948cb 100644 --- a/src/wifi/model/wifi-tx-timer.cc +++ b/src/wifi/model/wifi-tx-timer.cc @@ -116,10 +116,8 @@ WifiTxTimer::SetMpduResponseTimeoutCallback (MpduResponseTimeout callback) const m_mpduResponseTimeoutCallback = callback; } -template<> void -WifiTxTimer::FeedTraceSource, WifiTxVector> (Ptr item, - WifiTxVector txVector) +WifiTxTimer::FeedTraceSource (Ptr item, WifiTxVector txVector) { if (!m_mpduResponseTimeoutCallback.IsNull ()) { @@ -133,10 +131,8 @@ WifiTxTimer::SetPsduResponseTimeoutCallback (PsduResponseTimeout callback) const m_psduResponseTimeoutCallback = callback; } -template<> void -WifiTxTimer::FeedTraceSource, WifiTxVector> (Ptr psdu, - WifiTxVector txVector) +WifiTxTimer::FeedTraceSource (Ptr psdu, WifiTxVector txVector) { if (!m_psduResponseTimeoutCallback.IsNull ()) { @@ -150,11 +146,9 @@ WifiTxTimer::SetPsduMapResponseTimeoutCallback (PsduMapResponseTimeout callback) m_psduMapResponseTimeoutCallback = callback; } -template<> void -WifiTxTimer::FeedTraceSource*, std::size_t> (WifiPsduMap* psduMap, - std::set* missingStations, - std::size_t nTotalStations) +WifiTxTimer::FeedTraceSource (WifiPsduMap* psduMap, std::set* missingStations, + std::size_t nTotalStations) { if (!m_psduMapResponseTimeoutCallback.IsNull ()) { diff --git a/src/wifi/model/wifi-tx-timer.h b/src/wifi/model/wifi-tx-timer.h index b19ee4c12..c40966566 100644 --- a/src/wifi/model/wifi-tx-timer.h +++ b/src/wifi/model/wifi-tx-timer.h @@ -186,15 +186,33 @@ private: void Timeout (MEM mem_ptr, OBJ obj, Args... args); /** - * This method is called when the timer expires to feed the trace sources - * reporting timeout events. This method does nothing, while its specializations - * actually do the job of feeding the trace sources. + * This method is called when the timer expires to feed the MPDU response + * timeout callback. * - * \tparam Args \deduced Type template parameter pack - * \param args The arguments to pass to the trace sources + * \param item the MPDU followed by no response + * \param txVector the TXVECTOR used to transmit the MPDU */ - template - void FeedTraceSource (Args... args); + void FeedTraceSource (Ptr item, WifiTxVector txVector); + + /** + * This method is called when the timer expires to feed the PSDU response + * timeout callback. + * + * \param psdu the PSDU followed by no response + * \param txVector the TXVECTOR used to transmit the PSDU + */ + void FeedTraceSource (Ptr psdu, WifiTxVector txVector); + + /** + * This method is called when the timer expires to feed the PSDU map response + * timeout callback. + * + * \param psduMap the PSDU map for which not all responses were received + * \param missingStations the set of stations that did not respond + * \param nTotalStations the total number of expected responses + */ + void FeedTraceSource (WifiPsduMap* psduMap, std::set* missingStations, + std::size_t nTotalStations); EventId m_timeoutEvent; //!< the timeout event after a missing response Reason m_reason; //!< the reason why the timer was started @@ -212,50 +230,6 @@ private: } // namespace ns3 -/*************************************************************** - * Declaration of member function template specialization. - ***************************************************************/ - -namespace ns3 { - -/** - * Explicit specialization of the FeedTraceSource member function template - * that feeds the MPDU response timeout callback. - * - * \param item the MPDU followed by no response - * \param txVector the TXVECTOR used to transmit the MPDU - */ -template<> -void WifiTxTimer::FeedTraceSource, WifiTxVector> (Ptr item, - WifiTxVector txVector); - -/** - * Explicit specialization of the FeedTraceSource member function template - * that feeds the PSDU response timeout callback. - * - * \param psdu the PSDU followed by no response - * \param txVector the TXVECTOR used to transmit the PSDU - */ -template<> -void WifiTxTimer::FeedTraceSource, WifiTxVector> (Ptr psdu, - WifiTxVector txVector); - -/** - * Explicit specialization of the FeedTraceSource member function template - * that feeds the PSDU map response timeout callback. - * - * \param psduMap the PSDU map for which not all responses were received - * \param missingStations the set of stations that did not respond - * \param nTotalStations the total number of expected responses - */ -template<> -void WifiTxTimer::FeedTraceSource*, std::size_t> (WifiPsduMap* psduMap, - std::set* missingStations, - std::size_t nTotalStations); - -} // namespace ns3 - - /*************************************************************** * Implementation of the templates declared above. ***************************************************************/ @@ -287,12 +261,6 @@ WifiTxTimer::Timeout (MEM mem_ptr, OBJ obj, Args... args) ((*obj).*mem_ptr)(std::forward (args)...); } -template -void -WifiTxTimer::FeedTraceSource (Args... args) -{ -} - } //namespace ns3 #endif /* WIFI_TX_TIMER_H */