From f6dea45d3f49c02c2fd1abf83edc55332397693d Mon Sep 17 00:00:00 2001 From: Nicola Baldo Date: Fri, 27 Jan 2012 13:34:21 +0100 Subject: [PATCH] Backed out changeset 4850866f297b (SpectrumChannel::RemoveRx) --- .../model/multi-model-spectrum-channel.cc | 37 ------------------- .../model/multi-model-spectrum-channel.h | 1 - .../model/single-model-spectrum-channel.cc | 21 ----------- .../model/single-model-spectrum-channel.h | 1 - src/spectrum/model/spectrum-channel.h | 12 +----- 5 files changed, 1 insertion(+), 71 deletions(-) diff --git a/src/spectrum/model/multi-model-spectrum-channel.cc b/src/spectrum/model/multi-model-spectrum-channel.cc index 91b07372d..29489d9f5 100644 --- a/src/spectrum/model/multi-model-spectrum-channel.cc +++ b/src/spectrum/model/multi-model-spectrum-channel.cc @@ -181,43 +181,6 @@ MultiModelSpectrumChannel::AddRx (Ptr phy) } -void -MultiModelSpectrumChannel::RemoveRx (Ptr phy) -{ - NS_LOG_FUNCTION (this << phy); - - bool found = false; - for (std::vector >::iterator it = m_phyVector.begin (); it != m_phyVector.end (); ++it) - { - if (*it == phy) - { - m_phyVector.erase (it); - found = true; - break; - } - } - if (!found) - { - NS_LOG_WARN ("phy instance " << phy << " not found"); - } - else - { - - Ptr rxSpectrumModel = phy->GetRxSpectrumModel (); - - NS_ASSERT_MSG ((0 != rxSpectrumModel), "phy->GetRxSpectrumModel () returned 0. Please check that the RxSpectrumModel is already set for the phy before calling MultiModelSpectrumChannel::AddRx (phy)"); - - SpectrumModelUid_t rxSpectrumModelUid = rxSpectrumModel->GetUid (); - RxSpectrumModelInfoMap_t::iterator rxInfoIterator = m_rxSpectrumModelInfoMap.find (rxSpectrumModelUid); - NS_ASSERT (rxInfoIterator != m_rxSpectrumModelInfoMap.end ()); - rxInfoIterator->second.m_rxPhyList.remove (phy); - if (rxInfoIterator->second.m_rxPhyList.empty ()) - { - // no more PHY instances with this spectrum model, so we can remove the converter - m_rxSpectrumModelInfoMap.erase (rxInfoIterator); - } - } -} TxSpectrumModelInfoMap_t::const_iterator MultiModelSpectrumChannel::FindAndEventuallyAddTxSpectrumModel (Ptr txSpectrumModel) diff --git a/src/spectrum/model/multi-model-spectrum-channel.h b/src/spectrum/model/multi-model-spectrum-channel.h index b4b6ccce1..6c40e7f44 100644 --- a/src/spectrum/model/multi-model-spectrum-channel.h +++ b/src/spectrum/model/multi-model-spectrum-channel.h @@ -92,7 +92,6 @@ public: virtual void AddSpectrumPropagationLossModel (Ptr loss); virtual void SetPropagationDelayModel (Ptr delay); virtual void AddRx (Ptr phy); - virtual void RemoveRx (Ptr phy); virtual void StartTx (Ptr params); diff --git a/src/spectrum/model/single-model-spectrum-channel.cc b/src/spectrum/model/single-model-spectrum-channel.cc index c9011e85b..3a58f0eff 100644 --- a/src/spectrum/model/single-model-spectrum-channel.cc +++ b/src/spectrum/model/single-model-spectrum-channel.cc @@ -105,27 +105,6 @@ SingleModelSpectrumChannel::AddRx (Ptr phy) } -void -SingleModelSpectrumChannel::RemoveRx (Ptr phy) -{ - NS_LOG_FUNCTION (this << phy); - bool found = false; - for (std::vector >::iterator it = m_phyList.begin (); it != m_phyList.end (); ++it) - { - if (*it == phy) - { - m_phyList.erase (it); - found = true; - break; - } - } - if (!found) - { - NS_LOG_WARN ("phy instance " << phy << " not found"); - } -} - - void SingleModelSpectrumChannel::StartTx (Ptr txParams) { diff --git a/src/spectrum/model/single-model-spectrum-channel.h b/src/spectrum/model/single-model-spectrum-channel.h index 8281ec5e0..2320e541f 100644 --- a/src/spectrum/model/single-model-spectrum-channel.h +++ b/src/spectrum/model/single-model-spectrum-channel.h @@ -51,7 +51,6 @@ public: virtual void AddSpectrumPropagationLossModel (Ptr loss); virtual void SetPropagationDelayModel (Ptr delay); virtual void AddRx (Ptr phy); - virtual void RemoveRx (Ptr phy); virtual void StartTx (Ptr params); diff --git a/src/spectrum/model/spectrum-channel.h b/src/spectrum/model/spectrum-channel.h index 52dda9ffa..a45fc4a82 100644 --- a/src/spectrum/model/spectrum-channel.h +++ b/src/spectrum/model/spectrum-channel.h @@ -79,8 +79,7 @@ public: virtual void StartTx (Ptr params) = 0; /** - * @brief add a SpectrumPhy to a channel, so it can receive signals - * transmitted over the channel + * @brief add a SpectrumPhy to a channel, so it can receive packets * * This method is used to attach a SpectrumPhy instance to a * SpectrumChannel instance, so that the SpectrumPhy can receive @@ -96,15 +95,6 @@ public: */ virtual void AddRx (Ptr phy) = 0; - /** - * @brief remove a previously added SpectrumPhy from the channel, so - * that it will not receive any more signals transmitted on the channel - * - * - * @param phy the SpectrumPhy instance to be removed from the channel - */ - virtual void RemoveRx (Ptr phy) = 0; - };