merge
authorNicola Baldo <nbaldo@cttc.es>
Fri, 27 Jan 2012 13:40:22 +0100
changeset 8592 4270fe746971
parent 8590 c634b78e8550 (current diff)
parent 8591 a1e2385390d6 (diff)
child 8594 cc78cd035e5c
merge
--- a/src/spectrum/model/multi-model-spectrum-channel.cc	Thu Jan 26 16:37:31 2012 +0100
+++ b/src/spectrum/model/multi-model-spectrum-channel.cc	Fri Jan 27 13:40:22 2012 +0100
@@ -181,43 +181,6 @@
 
 }
 
-void
-MultiModelSpectrumChannel::RemoveRx (Ptr<SpectrumPhy> phy)
-{
-  NS_LOG_FUNCTION (this << phy);
-
-  bool found = false;
-  for (std::vector<Ptr<SpectrumPhy> >::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<const SpectrumModel> 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<const SpectrumModel> txSpectrumModel)
--- a/src/spectrum/model/multi-model-spectrum-channel.h	Thu Jan 26 16:37:31 2012 +0100
+++ b/src/spectrum/model/multi-model-spectrum-channel.h	Fri Jan 27 13:40:22 2012 +0100
@@ -92,7 +92,6 @@
   virtual void AddSpectrumPropagationLossModel (Ptr<SpectrumPropagationLossModel> loss);
   virtual void SetPropagationDelayModel (Ptr<PropagationDelayModel> delay);
   virtual void AddRx (Ptr<SpectrumPhy> phy);
-  virtual void RemoveRx (Ptr<SpectrumPhy> phy);
   virtual void StartTx (Ptr<SpectrumSignalParameters> params);
 
 
--- a/src/spectrum/model/single-model-spectrum-channel.cc	Thu Jan 26 16:37:31 2012 +0100
+++ b/src/spectrum/model/single-model-spectrum-channel.cc	Fri Jan 27 13:40:22 2012 +0100
@@ -106,27 +106,6 @@
 
 
 void
-SingleModelSpectrumChannel::RemoveRx (Ptr<SpectrumPhy> phy)
-{
-  NS_LOG_FUNCTION (this << phy);
-  bool found = false;
-  for (std::vector<Ptr<SpectrumPhy> >::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<SpectrumSignalParameters> txParams)
 {
   NS_LOG_FUNCTION (this << txParams->psd << txParams->duration << txParams->txPhy);
--- a/src/spectrum/model/single-model-spectrum-channel.h	Thu Jan 26 16:37:31 2012 +0100
+++ b/src/spectrum/model/single-model-spectrum-channel.h	Fri Jan 27 13:40:22 2012 +0100
@@ -51,7 +51,6 @@
   virtual void AddSpectrumPropagationLossModel (Ptr<SpectrumPropagationLossModel> loss);
   virtual void SetPropagationDelayModel (Ptr<PropagationDelayModel> delay);
   virtual void AddRx (Ptr<SpectrumPhy> phy);
-  virtual void RemoveRx (Ptr<SpectrumPhy> phy);
   virtual void StartTx (Ptr<SpectrumSignalParameters> params);
 
 
--- a/src/spectrum/model/spectrum-channel.h	Thu Jan 26 16:37:31 2012 +0100
+++ b/src/spectrum/model/spectrum-channel.h	Fri Jan 27 13:40:22 2012 +0100
@@ -79,8 +79,7 @@
   virtual void StartTx (Ptr<SpectrumSignalParameters> 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 @@
    */
   virtual void AddRx (Ptr<SpectrumPhy> 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<SpectrumPhy> phy) = 0;
-
 };