Backed out changeset 4850866f297b (SpectrumChannel::RemoveRx)

This commit is contained in:
Nicola Baldo
2012-01-27 13:34:21 +01:00
parent 244dca6b6c
commit f6dea45d3f
5 changed files with 1 additions and 71 deletions

View File

@@ -181,43 +181,6 @@ MultiModelSpectrumChannel::AddRx (Ptr<SpectrumPhy> phy)
}
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)

View File

@@ -92,7 +92,6 @@ public:
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);

View File

@@ -105,27 +105,6 @@ SingleModelSpectrumChannel::AddRx (Ptr<SpectrumPhy> phy)
}
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)
{

View File

@@ -51,7 +51,6 @@ public:
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);

View File

@@ -79,8 +79,7 @@ public:
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 @@ public:
*/
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;
};