GetDevice() should be const.
--- a/src/lr-wpan/model/lr-wpan-phy.cc Wed Jul 29 12:44:41 2015 -0700
+++ b/src/lr-wpan/model/lr-wpan-phy.cc Thu Aug 13 12:10:01 2015 -0700
@@ -194,7 +194,7 @@
}
Ptr<NetDevice>
-LrWpanPhy::GetDevice (void)
+LrWpanPhy::GetDevice (void) const
{
NS_LOG_FUNCTION (this);
return m_device;
--- a/src/lr-wpan/model/lr-wpan-phy.h Wed Jul 29 12:44:41 2015 -0700
+++ b/src/lr-wpan/model/lr-wpan-phy.h Thu Aug 13 12:10:01 2015 -0700
@@ -272,7 +272,7 @@
*/
Ptr<SpectrumChannel> GetChannel (void);
void SetDevice (Ptr<NetDevice> d);
- Ptr<NetDevice> GetDevice (void);
+ Ptr<NetDevice> GetDevice (void) const;
/**
* Set the attached antenna.
--- a/src/lte/model/lte-phy.cc Wed Jul 29 12:44:41 2015 -0700
+++ b/src/lte/model/lte-phy.cc Thu Aug 13 12:10:01 2015 -0700
@@ -94,7 +94,7 @@
Ptr<LteNetDevice>
-LtePhy::GetDevice ()
+LtePhy::GetDevice () const
{
NS_LOG_FUNCTION (this);
return m_netDevice;
--- a/src/lte/model/lte-phy.h Wed Jul 29 12:44:41 2015 -0700
+++ b/src/lte/model/lte-phy.h Thu Aug 13 12:10:01 2015 -0700
@@ -78,7 +78,7 @@
* \brief Get the device where the phy layer is attached
* \return the pointer to the device
*/
- Ptr<LteNetDevice> GetDevice ();
+ Ptr<LteNetDevice> GetDevice () const;
/**
*
--- a/src/lte/model/lte-spectrum-phy.cc Wed Jul 29 12:44:41 2015 -0700
+++ b/src/lte/model/lte-spectrum-phy.cc Thu Aug 13 12:10:01 2015 -0700
@@ -238,7 +238,7 @@
Ptr<NetDevice>
-LteSpectrumPhy::GetDevice ()
+LteSpectrumPhy::GetDevice () const
{
NS_LOG_FUNCTION (this);
return m_device;
--- a/src/lte/model/lte-spectrum-phy.h Wed Jul 29 12:44:41 2015 -0700
+++ b/src/lte/model/lte-spectrum-phy.h Thu Aug 13 12:10:01 2015 -0700
@@ -174,7 +174,7 @@
void SetMobility (Ptr<MobilityModel> m);
void SetDevice (Ptr<NetDevice> d);
Ptr<MobilityModel> GetMobility ();
- Ptr<NetDevice> GetDevice ();
+ Ptr<NetDevice> GetDevice () const;
Ptr<const SpectrumModel> GetRxSpectrumModel () const;
Ptr<AntennaModel> GetRxAntenna ();
void StartRx (Ptr<SpectrumSignalParameters> params);
--- a/src/lte/model/rem-spectrum-phy.cc Wed Jul 29 12:44:41 2015 -0700
+++ b/src/lte/model/rem-spectrum-phy.cc Thu Aug 13 12:10:01 2015 -0700
@@ -103,7 +103,7 @@
}
Ptr<NetDevice>
-RemSpectrumPhy::GetDevice ()
+RemSpectrumPhy::GetDevice () const
{
return 0;
}
--- a/src/lte/model/rem-spectrum-phy.h Wed Jul 29 12:44:41 2015 -0700
+++ b/src/lte/model/rem-spectrum-phy.h Thu Aug 13 12:10:01 2015 -0700
@@ -64,7 +64,7 @@
void SetMobility (Ptr<MobilityModel> m);
void SetDevice (Ptr<NetDevice> d);
Ptr<MobilityModel> GetMobility ();
- Ptr<NetDevice> GetDevice ();
+ Ptr<NetDevice> GetDevice () const;
Ptr<const SpectrumModel> GetRxSpectrumModel () const;
Ptr<AntennaModel> GetRxAntenna ();
void StartRx (Ptr<SpectrumSignalParameters> params);
--- a/src/lte/test/lte-simple-spectrum-phy.cc Wed Jul 29 12:44:41 2015 -0700
+++ b/src/lte/test/lte-simple-spectrum-phy.cc Thu Aug 13 12:10:01 2015 -0700
@@ -73,7 +73,7 @@
Ptr<NetDevice>
-LteSimpleSpectrumPhy::GetDevice ()
+LteSimpleSpectrumPhy::GetDevice () const
{
NS_LOG_FUNCTION (this);
return m_device;
--- a/src/lte/test/lte-simple-spectrum-phy.h Wed Jul 29 12:44:41 2015 -0700
+++ b/src/lte/test/lte-simple-spectrum-phy.h Thu Aug 13 12:10:01 2015 -0700
@@ -60,7 +60,7 @@
void SetMobility (Ptr<MobilityModel> m);
void SetDevice (Ptr<NetDevice> d);
Ptr<MobilityModel> GetMobility ();
- Ptr<NetDevice> GetDevice ();
+ Ptr<NetDevice> GetDevice () const;
Ptr<const SpectrumModel> GetRxSpectrumModel () const;
Ptr<AntennaModel> GetRxAntenna ();
void StartRx (Ptr<SpectrumSignalParameters> params);
--- a/src/spectrum/model/half-duplex-ideal-phy.cc Wed Jul 29 12:44:41 2015 -0700
+++ b/src/spectrum/model/half-duplex-ideal-phy.cc Thu Aug 13 12:10:01 2015 -0700
@@ -135,7 +135,7 @@
Ptr<NetDevice>
-HalfDuplexIdealPhy::GetDevice ()
+HalfDuplexIdealPhy::GetDevice () const
{
NS_LOG_FUNCTION (this);
return m_netDevice;
--- a/src/spectrum/model/half-duplex-ideal-phy.h Wed Jul 29 12:44:41 2015 -0700
+++ b/src/spectrum/model/half-duplex-ideal-phy.h Thu Aug 13 12:10:01 2015 -0700
@@ -98,7 +98,7 @@
void SetMobility (Ptr<MobilityModel> m);
void SetDevice (Ptr<NetDevice> d);
Ptr<MobilityModel> GetMobility ();
- Ptr<NetDevice> GetDevice ();
+ Ptr<NetDevice> GetDevice () const;
Ptr<const SpectrumModel> GetRxSpectrumModel () const;
Ptr<AntennaModel> GetRxAntenna ();
void StartRx (Ptr<SpectrumSignalParameters> params);
--- a/src/spectrum/model/spectrum-analyzer.cc Wed Jul 29 12:44:41 2015 -0700
+++ b/src/spectrum/model/spectrum-analyzer.cc Thu Aug 13 12:10:01 2015 -0700
@@ -99,7 +99,7 @@
Ptr<NetDevice>
-SpectrumAnalyzer::GetDevice ()
+SpectrumAnalyzer::GetDevice () const
{
return m_netDevice;
}
--- a/src/spectrum/model/spectrum-analyzer.h Wed Jul 29 12:44:41 2015 -0700
+++ b/src/spectrum/model/spectrum-analyzer.h Thu Aug 13 12:10:01 2015 -0700
@@ -59,7 +59,7 @@
void SetMobility (Ptr<MobilityModel> m);
void SetDevice (Ptr<NetDevice> d);
Ptr<MobilityModel> GetMobility ();
- Ptr<NetDevice> GetDevice ();
+ Ptr<NetDevice> GetDevice () const;
Ptr<const SpectrumModel> GetRxSpectrumModel () const;
Ptr<AntennaModel> GetRxAntenna ();
void StartRx (Ptr<SpectrumSignalParameters> params);
--- a/src/spectrum/model/spectrum-phy.h Wed Jul 29 12:44:41 2015 -0700
+++ b/src/spectrum/model/spectrum-phy.h Thu Aug 13 12:10:01 2015 -0700
@@ -63,7 +63,7 @@
*
* @return a Ptr to the associated NetDevice instance
*/
- virtual Ptr<NetDevice> GetDevice () = 0;
+ virtual Ptr<NetDevice> GetDevice () const = 0;
/**
* Set the mobility model associated with this device.
--- a/src/spectrum/model/tv-spectrum-transmitter.cc Wed Jul 29 12:44:41 2015 -0700
+++ b/src/spectrum/model/tv-spectrum-transmitter.cc Thu Aug 13 12:10:01 2015 -0700
@@ -151,7 +151,7 @@
}
Ptr<NetDevice>
-TvSpectrumTransmitter::GetDevice ()
+TvSpectrumTransmitter::GetDevice () const
{
NS_LOG_FUNCTION (this);
return m_netDevice;
--- a/src/spectrum/model/tv-spectrum-transmitter.h Wed Jul 29 12:44:41 2015 -0700
+++ b/src/spectrum/model/tv-spectrum-transmitter.h Thu Aug 13 12:10:01 2015 -0700
@@ -71,7 +71,7 @@
void SetMobility (Ptr<MobilityModel> m);
void SetDevice (Ptr<NetDevice> d);
Ptr<MobilityModel> GetMobility ();
- Ptr<NetDevice> GetDevice ();
+ Ptr<NetDevice> GetDevice () const;
// device does not use Rx but these pure virtual methods must be implemented
Ptr<const SpectrumModel> GetRxSpectrumModel () const;
Ptr<AntennaModel> GetRxAntenna ();
--- a/src/spectrum/model/waveform-generator.cc Wed Jul 29 12:44:41 2015 -0700
+++ b/src/spectrum/model/waveform-generator.cc Thu Aug 13 12:10:01 2015 -0700
@@ -98,7 +98,7 @@
Ptr<NetDevice>
-WaveformGenerator::GetDevice ()
+WaveformGenerator::GetDevice () const
{
return m_netDevice;
}
--- a/src/spectrum/model/waveform-generator.h Wed Jul 29 12:44:41 2015 -0700
+++ b/src/spectrum/model/waveform-generator.h Thu Aug 13 12:10:01 2015 -0700
@@ -64,7 +64,7 @@
void SetMobility (Ptr<MobilityModel> m);
void SetDevice (Ptr<NetDevice> d);
Ptr<MobilityModel> GetMobility ();
- Ptr<NetDevice> GetDevice ();
+ Ptr<NetDevice> GetDevice () const;
Ptr<const SpectrumModel> GetRxSpectrumModel () const;
Ptr<AntennaModel> GetRxAntenna ();
void StartRx (Ptr<SpectrumSignalParameters> params);
--- a/src/uan/model/uan-phy-dual.cc Wed Jul 29 12:44:41 2015 -0700
+++ b/src/uan/model/uan-phy-dual.cc Thu Aug 13 12:10:01 2015 -0700
@@ -498,7 +498,7 @@
return m_phy1->GetChannel ();
}
Ptr<UanNetDevice>
-UanPhyDual::GetDevice (void)
+UanPhyDual::GetDevice (void) const
{
return m_phy1->GetDevice ();
}
--- a/src/uan/model/uan-phy-dual.h Wed Jul 29 12:44:41 2015 -0700
+++ b/src/uan/model/uan-phy-dual.h Thu Aug 13 12:10:01 2015 -0700
@@ -126,7 +126,7 @@
virtual bool IsStateTx (void);
virtual bool IsStateCcaBusy (void);
virtual Ptr<UanChannel> GetChannel (void) const;
- virtual Ptr<UanNetDevice> GetDevice (void);
+ virtual Ptr<UanNetDevice> GetDevice (void) const;
virtual void SetChannel (Ptr<UanChannel> channel);
virtual void SetDevice (Ptr<UanNetDevice> device);
virtual void SetMac (Ptr<UanMac> mac);
--- a/src/uan/model/uan-phy-gen.cc Wed Jul 29 12:44:41 2015 -0700
+++ b/src/uan/model/uan-phy-gen.cc Thu Aug 13 12:10:01 2015 -0700
@@ -809,7 +809,7 @@
}
Ptr<UanNetDevice>
-UanPhyGen::GetDevice (void)
+UanPhyGen::GetDevice (void) const
{
return m_device;
}
--- a/src/uan/model/uan-phy-gen.h Wed Jul 29 12:44:41 2015 -0700
+++ b/src/uan/model/uan-phy-gen.h Thu Aug 13 12:10:01 2015 -0700
@@ -260,7 +260,7 @@
virtual double GetRxThresholdDb (void);
virtual double GetCcaThresholdDb (void);
virtual Ptr<UanChannel> GetChannel (void) const;
- virtual Ptr<UanNetDevice> GetDevice (void);
+ virtual Ptr<UanNetDevice> GetDevice (void) const;
virtual Ptr<UanTransducer> GetTransducer (void);
virtual void SetChannel (Ptr<UanChannel> channel);
virtual void SetDevice (Ptr<UanNetDevice> device);
--- a/src/uan/model/uan-phy.h Wed Jul 29 12:44:41 2015 -0700
+++ b/src/uan/model/uan-phy.h Thu Aug 13 12:10:01 2015 -0700
@@ -345,7 +345,7 @@
*
* \return The net device.
*/
- virtual Ptr<UanNetDevice> GetDevice (void) = 0;
+ virtual Ptr<UanNetDevice> GetDevice (void) const = 0;
/**
* Attach to a channel.