diff --git a/src/lte/model/lte-phy.cc b/src/lte/model/lte-phy.cc index f428368fe..faaadd0a5 100644 --- a/src/lte/model/lte-phy.cc +++ b/src/lte/model/lte-phy.cc @@ -144,15 +144,6 @@ LtePhy::SetDownlinkChannel (Ptr c) m_downlinkSpectrumPhy->SetChannel (c); } - -Ptr -LtePhy::GetDownlinkChannel () -{ - NS_LOG_FUNCTION (this); - return m_downlinkSpectrumPhy->GetChannel (); -} - - void LtePhy::SetUplinkChannel (Ptr c) { @@ -160,15 +151,6 @@ LtePhy::SetUplinkChannel (Ptr c) m_uplinkSpectrumPhy->SetChannel (c); } - -Ptr -LtePhy::GetUplinkChannel () -{ - NS_LOG_FUNCTION (this); - return m_uplinkSpectrumPhy->GetChannel (); -} - - void LtePhy::SetDownlinkSubChannels (std::vector mask ) { diff --git a/src/lte/model/lte-phy.h b/src/lte/model/lte-phy.h index 6e24114f1..af457faf4 100644 --- a/src/lte/model/lte-phy.h +++ b/src/lte/model/lte-phy.h @@ -100,24 +100,12 @@ public: */ void SetDownlinkChannel (Ptr c); - /** - * Get the downlink channel - * \return a Ptr to the downlink SpectrumChannel - */ - Ptr GetDownlinkChannel (); - /** * Set the uplink channel * \param c the uplink channel */ void SetUplinkChannel (Ptr c); - /** - * Get the uplink channel - * \return a Ptr to the uplink SpectrumChannel - */ - Ptr GetUplinkChannel (); - /** * \brief set a list of sub channel to use in the downlink. * A sub channel is composed by a couple of resource bloks (180KHz x 1 ms) diff --git a/src/lte/model/lte-spectrum-phy.cc b/src/lte/model/lte-spectrum-phy.cc index 08e49dceb..63258f6a8 100644 --- a/src/lte/model/lte-spectrum-phy.cc +++ b/src/lte/model/lte-spectrum-phy.cc @@ -39,11 +39,7 @@ namespace ns3 { NS_OBJECT_ENSURE_REGISTERED (LteSpectrumPhy); LteSpectrumPhy::LteSpectrumPhy () - : m_mobility (0), - m_device (0), - m_channel (0), - m_txPsd (0), - m_state (IDLE) + : m_state (IDLE) { } @@ -52,6 +48,14 @@ LteSpectrumPhy::~LteSpectrumPhy () { } +void LteSpectrumPhy::DoDispose () +{ + m_channel->Dispose (); + m_channel = 0; + m_mobility = 0; + m_device = 0; +} + std::ostream& operator<< (std::ostream& os, LteSpectrumPhy::State s) { switch (s) @@ -141,14 +145,6 @@ LteSpectrumPhy::SetChannel (Ptr c) m_channel = c; } - -Ptr -LteSpectrumPhy::GetChannel (void) -{ - return m_channel; -} - - Ptr LteSpectrumPhy::GetRxSpectrumModel () const { diff --git a/src/lte/model/lte-spectrum-phy.h b/src/lte/model/lte-spectrum-phy.h index abe314180..4ebe519c8 100644 --- a/src/lte/model/lte-spectrum-phy.h +++ b/src/lte/model/lte-spectrum-phy.h @@ -61,6 +61,7 @@ public: // inherited from Object static TypeId GetTypeId (void); + virtual void DoDispose (); // inherited from SpectrumPhy void SetChannel (Ptr c); @@ -72,13 +73,6 @@ public: void StartRx (Ptr pb, Ptr rxPsd, SpectrumType st, Time duration); - /** - * \brief Get the channel where the physical layer is attached - * \return a pointer to the channel - */ - Ptr GetChannel (void); - - /** * Get the SpectrumType used by this PHY *