From 6c8fcc72b9766a8adc2a8c78795f0efbfa10b92f Mon Sep 17 00:00:00 2001 From: "Peter D. Barnes, Jr." Date: Thu, 13 Aug 2015 12:10:01 -0700 Subject: [PATCH] GetDevice() should be const. --- src/lr-wpan/model/lr-wpan-phy.cc | 2 +- src/lr-wpan/model/lr-wpan-phy.h | 2 +- src/lte/model/lte-phy.cc | 2 +- src/lte/model/lte-phy.h | 2 +- src/lte/model/lte-spectrum-phy.cc | 2 +- src/lte/model/lte-spectrum-phy.h | 2 +- src/lte/model/rem-spectrum-phy.cc | 2 +- src/lte/model/rem-spectrum-phy.h | 2 +- src/lte/test/lte-simple-spectrum-phy.cc | 2 +- src/lte/test/lte-simple-spectrum-phy.h | 2 +- src/spectrum/model/half-duplex-ideal-phy.cc | 2 +- src/spectrum/model/half-duplex-ideal-phy.h | 2 +- src/spectrum/model/spectrum-analyzer.cc | 2 +- src/spectrum/model/spectrum-analyzer.h | 2 +- src/spectrum/model/spectrum-phy.h | 2 +- src/spectrum/model/tv-spectrum-transmitter.cc | 2 +- src/spectrum/model/tv-spectrum-transmitter.h | 2 +- src/spectrum/model/waveform-generator.cc | 2 +- src/spectrum/model/waveform-generator.h | 2 +- src/uan/model/uan-phy-dual.cc | 2 +- src/uan/model/uan-phy-dual.h | 2 +- src/uan/model/uan-phy-gen.cc | 2 +- src/uan/model/uan-phy-gen.h | 2 +- src/uan/model/uan-phy.h | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/lr-wpan/model/lr-wpan-phy.cc b/src/lr-wpan/model/lr-wpan-phy.cc index e0c416a86..1cb8047ca 100644 --- a/src/lr-wpan/model/lr-wpan-phy.cc +++ b/src/lr-wpan/model/lr-wpan-phy.cc @@ -194,7 +194,7 @@ LrWpanPhy::DoDispose (void) } Ptr -LrWpanPhy::GetDevice (void) +LrWpanPhy::GetDevice (void) const { NS_LOG_FUNCTION (this); return m_device; diff --git a/src/lr-wpan/model/lr-wpan-phy.h b/src/lr-wpan/model/lr-wpan-phy.h index 81b55e0cc..55f7a4333 100644 --- a/src/lr-wpan/model/lr-wpan-phy.h +++ b/src/lr-wpan/model/lr-wpan-phy.h @@ -272,7 +272,7 @@ public: */ Ptr GetChannel (void); void SetDevice (Ptr d); - Ptr GetDevice (void); + Ptr GetDevice (void) const; /** * Set the attached antenna. diff --git a/src/lte/model/lte-phy.cc b/src/lte/model/lte-phy.cc index 61eb71dc4..a7a54e899 100644 --- a/src/lte/model/lte-phy.cc +++ b/src/lte/model/lte-phy.cc @@ -94,7 +94,7 @@ LtePhy::SetDevice (Ptr d) Ptr -LtePhy::GetDevice () +LtePhy::GetDevice () const { NS_LOG_FUNCTION (this); return m_netDevice; diff --git a/src/lte/model/lte-phy.h b/src/lte/model/lte-phy.h index e4f94946f..1bf1c28a3 100644 --- a/src/lte/model/lte-phy.h +++ b/src/lte/model/lte-phy.h @@ -78,7 +78,7 @@ public: * \brief Get the device where the phy layer is attached * \return the pointer to the device */ - Ptr GetDevice (); + Ptr GetDevice () const; /** * diff --git a/src/lte/model/lte-spectrum-phy.cc b/src/lte/model/lte-spectrum-phy.cc index c6106cf27..038c3d113 100644 --- a/src/lte/model/lte-spectrum-phy.cc +++ b/src/lte/model/lte-spectrum-phy.cc @@ -238,7 +238,7 @@ LteSpectrumPhy::GetTypeId (void) Ptr -LteSpectrumPhy::GetDevice () +LteSpectrumPhy::GetDevice () const { NS_LOG_FUNCTION (this); return m_device; diff --git a/src/lte/model/lte-spectrum-phy.h b/src/lte/model/lte-spectrum-phy.h index 6b9caddb1..d987c4a49 100644 --- a/src/lte/model/lte-spectrum-phy.h +++ b/src/lte/model/lte-spectrum-phy.h @@ -174,7 +174,7 @@ public: void SetMobility (Ptr m); void SetDevice (Ptr d); Ptr GetMobility (); - Ptr GetDevice (); + Ptr GetDevice () const; Ptr GetRxSpectrumModel () const; Ptr GetRxAntenna (); void StartRx (Ptr params); diff --git a/src/lte/model/rem-spectrum-phy.cc b/src/lte/model/rem-spectrum-phy.cc index 76a3122ae..28976e74c 100644 --- a/src/lte/model/rem-spectrum-phy.cc +++ b/src/lte/model/rem-spectrum-phy.cc @@ -103,7 +103,7 @@ RemSpectrumPhy::GetMobility () } Ptr -RemSpectrumPhy::GetDevice () +RemSpectrumPhy::GetDevice () const { return 0; } diff --git a/src/lte/model/rem-spectrum-phy.h b/src/lte/model/rem-spectrum-phy.h index 5b832762b..c95d12009 100644 --- a/src/lte/model/rem-spectrum-phy.h +++ b/src/lte/model/rem-spectrum-phy.h @@ -64,7 +64,7 @@ public: void SetMobility (Ptr m); void SetDevice (Ptr d); Ptr GetMobility (); - Ptr GetDevice (); + Ptr GetDevice () const; Ptr GetRxSpectrumModel () const; Ptr GetRxAntenna (); void StartRx (Ptr params); diff --git a/src/lte/test/lte-simple-spectrum-phy.cc b/src/lte/test/lte-simple-spectrum-phy.cc index b0f2ffdae..7ace4aa84 100644 --- a/src/lte/test/lte-simple-spectrum-phy.cc +++ b/src/lte/test/lte-simple-spectrum-phy.cc @@ -73,7 +73,7 @@ LteSimpleSpectrumPhy::GetTypeId (void) Ptr -LteSimpleSpectrumPhy::GetDevice () +LteSimpleSpectrumPhy::GetDevice () const { NS_LOG_FUNCTION (this); return m_device; diff --git a/src/lte/test/lte-simple-spectrum-phy.h b/src/lte/test/lte-simple-spectrum-phy.h index 06b9bbf84..5b6c526d7 100644 --- a/src/lte/test/lte-simple-spectrum-phy.h +++ b/src/lte/test/lte-simple-spectrum-phy.h @@ -60,7 +60,7 @@ public: void SetMobility (Ptr m); void SetDevice (Ptr d); Ptr GetMobility (); - Ptr GetDevice (); + Ptr GetDevice () const; Ptr GetRxSpectrumModel () const; Ptr GetRxAntenna (); void StartRx (Ptr params); diff --git a/src/spectrum/model/half-duplex-ideal-phy.cc b/src/spectrum/model/half-duplex-ideal-phy.cc index 05fb8a124..96b61a083 100644 --- a/src/spectrum/model/half-duplex-ideal-phy.cc +++ b/src/spectrum/model/half-duplex-ideal-phy.cc @@ -135,7 +135,7 @@ HalfDuplexIdealPhy::GetTypeId (void) Ptr -HalfDuplexIdealPhy::GetDevice () +HalfDuplexIdealPhy::GetDevice () const { NS_LOG_FUNCTION (this); return m_netDevice; diff --git a/src/spectrum/model/half-duplex-ideal-phy.h b/src/spectrum/model/half-duplex-ideal-phy.h index 8fae43bef..624eae758 100644 --- a/src/spectrum/model/half-duplex-ideal-phy.h +++ b/src/spectrum/model/half-duplex-ideal-phy.h @@ -98,7 +98,7 @@ public: void SetMobility (Ptr m); void SetDevice (Ptr d); Ptr GetMobility (); - Ptr GetDevice (); + Ptr GetDevice () const; Ptr GetRxSpectrumModel () const; Ptr GetRxAntenna (); void StartRx (Ptr params); diff --git a/src/spectrum/model/spectrum-analyzer.cc b/src/spectrum/model/spectrum-analyzer.cc index ceb17801a..9be4063e5 100644 --- a/src/spectrum/model/spectrum-analyzer.cc +++ b/src/spectrum/model/spectrum-analyzer.cc @@ -99,7 +99,7 @@ SpectrumAnalyzer::GetTypeId (void) Ptr -SpectrumAnalyzer::GetDevice () +SpectrumAnalyzer::GetDevice () const { return m_netDevice; } diff --git a/src/spectrum/model/spectrum-analyzer.h b/src/spectrum/model/spectrum-analyzer.h index ec1f1e2c9..981238cfd 100644 --- a/src/spectrum/model/spectrum-analyzer.h +++ b/src/spectrum/model/spectrum-analyzer.h @@ -59,7 +59,7 @@ public: void SetMobility (Ptr m); void SetDevice (Ptr d); Ptr GetMobility (); - Ptr GetDevice (); + Ptr GetDevice () const; Ptr GetRxSpectrumModel () const; Ptr GetRxAntenna (); void StartRx (Ptr params); diff --git a/src/spectrum/model/spectrum-phy.h b/src/spectrum/model/spectrum-phy.h index 5f4dc3cd5..9c011f0c2 100644 --- a/src/spectrum/model/spectrum-phy.h +++ b/src/spectrum/model/spectrum-phy.h @@ -63,7 +63,7 @@ public: * * @return a Ptr to the associated NetDevice instance */ - virtual Ptr GetDevice () = 0; + virtual Ptr GetDevice () const = 0; /** * Set the mobility model associated with this device. diff --git a/src/spectrum/model/tv-spectrum-transmitter.cc b/src/spectrum/model/tv-spectrum-transmitter.cc index 92196a663..8e93f733a 100644 --- a/src/spectrum/model/tv-spectrum-transmitter.cc +++ b/src/spectrum/model/tv-spectrum-transmitter.cc @@ -151,7 +151,7 @@ TvSpectrumTransmitter::GetMobility () } Ptr -TvSpectrumTransmitter::GetDevice () +TvSpectrumTransmitter::GetDevice () const { NS_LOG_FUNCTION (this); return m_netDevice; diff --git a/src/spectrum/model/tv-spectrum-transmitter.h b/src/spectrum/model/tv-spectrum-transmitter.h index 43f12e848..4dc754e81 100644 --- a/src/spectrum/model/tv-spectrum-transmitter.h +++ b/src/spectrum/model/tv-spectrum-transmitter.h @@ -71,7 +71,7 @@ public: void SetMobility (Ptr m); void SetDevice (Ptr d); Ptr GetMobility (); - Ptr GetDevice (); + Ptr GetDevice () const; // device does not use Rx but these pure virtual methods must be implemented Ptr GetRxSpectrumModel () const; Ptr GetRxAntenna (); diff --git a/src/spectrum/model/waveform-generator.cc b/src/spectrum/model/waveform-generator.cc index 3891094d2..844d99055 100644 --- a/src/spectrum/model/waveform-generator.cc +++ b/src/spectrum/model/waveform-generator.cc @@ -98,7 +98,7 @@ WaveformGenerator::GetTypeId (void) Ptr -WaveformGenerator::GetDevice () +WaveformGenerator::GetDevice () const { return m_netDevice; } diff --git a/src/spectrum/model/waveform-generator.h b/src/spectrum/model/waveform-generator.h index b59cbd1af..ba2d4e47e 100644 --- a/src/spectrum/model/waveform-generator.h +++ b/src/spectrum/model/waveform-generator.h @@ -64,7 +64,7 @@ public: void SetMobility (Ptr m); void SetDevice (Ptr d); Ptr GetMobility (); - Ptr GetDevice (); + Ptr GetDevice () const; Ptr GetRxSpectrumModel () const; Ptr GetRxAntenna (); void StartRx (Ptr params); diff --git a/src/uan/model/uan-phy-dual.cc b/src/uan/model/uan-phy-dual.cc index 40c0716ac..67c8b30e9 100644 --- a/src/uan/model/uan-phy-dual.cc +++ b/src/uan/model/uan-phy-dual.cc @@ -498,7 +498,7 @@ UanPhyDual::GetChannel (void) const return m_phy1->GetChannel (); } Ptr -UanPhyDual::GetDevice (void) +UanPhyDual::GetDevice (void) const { return m_phy1->GetDevice (); } diff --git a/src/uan/model/uan-phy-dual.h b/src/uan/model/uan-phy-dual.h index 2576b5660..14a14cd0b 100644 --- a/src/uan/model/uan-phy-dual.h +++ b/src/uan/model/uan-phy-dual.h @@ -126,7 +126,7 @@ public: virtual bool IsStateTx (void); virtual bool IsStateCcaBusy (void); virtual Ptr GetChannel (void) const; - virtual Ptr GetDevice (void); + virtual Ptr GetDevice (void) const; virtual void SetChannel (Ptr channel); virtual void SetDevice (Ptr device); virtual void SetMac (Ptr mac); diff --git a/src/uan/model/uan-phy-gen.cc b/src/uan/model/uan-phy-gen.cc index 7463aa2e7..646882b8f 100644 --- a/src/uan/model/uan-phy-gen.cc +++ b/src/uan/model/uan-phy-gen.cc @@ -809,7 +809,7 @@ UanPhyGen::GetChannel (void) const } Ptr -UanPhyGen::GetDevice (void) +UanPhyGen::GetDevice (void) const { return m_device; } diff --git a/src/uan/model/uan-phy-gen.h b/src/uan/model/uan-phy-gen.h index 0f8b995d2..95f6b1d3a 100644 --- a/src/uan/model/uan-phy-gen.h +++ b/src/uan/model/uan-phy-gen.h @@ -260,7 +260,7 @@ public: virtual double GetRxThresholdDb (void); virtual double GetCcaThresholdDb (void); virtual Ptr GetChannel (void) const; - virtual Ptr GetDevice (void); + virtual Ptr GetDevice (void) const; virtual Ptr GetTransducer (void); virtual void SetChannel (Ptr channel); virtual void SetDevice (Ptr device); diff --git a/src/uan/model/uan-phy.h b/src/uan/model/uan-phy.h index d71aed5dc..ad4319edf 100644 --- a/src/uan/model/uan-phy.h +++ b/src/uan/model/uan-phy.h @@ -345,7 +345,7 @@ public: * * \return The net device. */ - virtual Ptr GetDevice (void) = 0; + virtual Ptr GetDevice (void) const = 0; /** * Attach to a channel.