GetDevice() should be const.

This commit is contained in:
Peter D. Barnes, Jr.
2015-08-13 12:10:01 -07:00
parent d81c292aba
commit de61c2f689
24 changed files with 24 additions and 24 deletions

View File

@@ -194,7 +194,7 @@ LrWpanPhy::DoDispose (void)
}
Ptr<NetDevice>
LrWpanPhy::GetDevice (void)
LrWpanPhy::GetDevice (void) const
{
NS_LOG_FUNCTION (this);
return m_device;

View File

@@ -272,7 +272,7 @@ public:
*/
Ptr<SpectrumChannel> GetChannel (void);
void SetDevice (Ptr<NetDevice> d);
Ptr<NetDevice> GetDevice (void);
Ptr<NetDevice> GetDevice (void) const;
/**
* Set the attached antenna.

View File

@@ -94,7 +94,7 @@ LtePhy::SetDevice (Ptr<LteNetDevice> d)
Ptr<LteNetDevice>
LtePhy::GetDevice ()
LtePhy::GetDevice () const
{
NS_LOG_FUNCTION (this);
return m_netDevice;

View File

@@ -78,7 +78,7 @@ public:
* \brief Get the device where the phy layer is attached
* \return the pointer to the device
*/
Ptr<LteNetDevice> GetDevice ();
Ptr<LteNetDevice> GetDevice () const;
/**
*

View File

@@ -238,7 +238,7 @@ LteSpectrumPhy::GetTypeId (void)
Ptr<NetDevice>
LteSpectrumPhy::GetDevice ()
LteSpectrumPhy::GetDevice () const
{
NS_LOG_FUNCTION (this);
return m_device;

View File

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

View File

@@ -103,7 +103,7 @@ RemSpectrumPhy::GetMobility ()
}
Ptr<NetDevice>
RemSpectrumPhy::GetDevice ()
RemSpectrumPhy::GetDevice () const
{
return 0;
}

View File

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

View File

@@ -73,7 +73,7 @@ LteSimpleSpectrumPhy::GetTypeId (void)
Ptr<NetDevice>
LteSimpleSpectrumPhy::GetDevice ()
LteSimpleSpectrumPhy::GetDevice () const
{
NS_LOG_FUNCTION (this);
return m_device;

View File

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

View File

@@ -135,7 +135,7 @@ HalfDuplexIdealPhy::GetTypeId (void)
Ptr<NetDevice>
HalfDuplexIdealPhy::GetDevice ()
HalfDuplexIdealPhy::GetDevice () const
{
NS_LOG_FUNCTION (this);
return m_netDevice;

View File

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

View File

@@ -99,7 +99,7 @@ SpectrumAnalyzer::GetTypeId (void)
Ptr<NetDevice>
SpectrumAnalyzer::GetDevice ()
SpectrumAnalyzer::GetDevice () const
{
return m_netDevice;
}

View File

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

View File

@@ -63,7 +63,7 @@ public:
*
* @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.

View File

@@ -151,7 +151,7 @@ TvSpectrumTransmitter::GetMobility ()
}
Ptr<NetDevice>
TvSpectrumTransmitter::GetDevice ()
TvSpectrumTransmitter::GetDevice () const
{
NS_LOG_FUNCTION (this);
return m_netDevice;

View File

@@ -71,7 +71,7 @@ public:
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 ();

View File

@@ -98,7 +98,7 @@ WaveformGenerator::GetTypeId (void)
Ptr<NetDevice>
WaveformGenerator::GetDevice ()
WaveformGenerator::GetDevice () const
{
return m_netDevice;
}

View File

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

View File

@@ -498,7 +498,7 @@ UanPhyDual::GetChannel (void) const
return m_phy1->GetChannel ();
}
Ptr<UanNetDevice>
UanPhyDual::GetDevice (void)
UanPhyDual::GetDevice (void) const
{
return m_phy1->GetDevice ();
}

View File

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

View File

@@ -809,7 +809,7 @@ UanPhyGen::GetChannel (void) const
}
Ptr<UanNetDevice>
UanPhyGen::GetDevice (void)
UanPhyGen::GetDevice (void) const
{
return m_device;
}

View File

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

View File

@@ -345,7 +345,7 @@ public:
*
* \return The net device.
*/
virtual Ptr<UanNetDevice> GetDevice (void) = 0;
virtual Ptr<UanNetDevice> GetDevice (void) const = 0;
/**
* Attach to a channel.