Added const to some Get functions in LTE module
authorBudiarto Herman <budiarto.herman@magister.fi>
Thu, 26 Sep 2013 13:22:58 +0300
changeset 10374 bad9fbe96995
parent 10373 9951a8926dc6
child 10375 5c7c6b7a2227
Added const to some Get functions in LTE module
src/lte/model/epc-ue-nas.cc
src/lte/model/epc-ue-nas.h
src/lte/model/lte-anr-sap.h
src/lte/model/lte-anr.cc
src/lte/model/lte-anr.h
src/lte/model/lte-enb-rrc.cc
src/lte/model/lte-enb-rrc.h
src/lte/model/lte-ue-phy.cc
src/lte/model/lte-ue-phy.h
src/lte/model/lte-ue-rrc.cc
src/lte/model/lte-ue-rrc.h
--- a/src/lte/model/epc-ue-nas.cc	Thu Sep 26 12:28:49 2013 +0300
+++ b/src/lte/model/epc-ue-nas.cc	Thu Sep 26 13:22:58 2013 +0300
@@ -272,6 +272,13 @@
   m_tftClassifier.Add (tft, bid);
 }
 
+EpcUeNas::State
+EpcUeNas::GetState () const
+{
+  NS_LOG_FUNCTION (this);
+  return m_state;
+}
+
 void 
 EpcUeNas::SwitchToState (State newState)
 {
--- a/src/lte/model/epc-ue-nas.h	Thu Sep 26 12:28:49 2013 +0300
+++ b/src/lte/model/epc-ue-nas.h	Thu Sep 26 13:22:58 2013 +0300
@@ -163,6 +163,11 @@
     NUM_STATES
   };
 
+  /**
+   * \return The current state
+   */
+  State GetState () const;
+
  
 private:
 
--- a/src/lte/model/lte-anr-sap.h	Thu Sep 26 12:28:49 2013 +0300
+++ b/src/lte/model/lte-anr-sap.h	Thu Sep 26 13:22:58 2013 +0300
@@ -62,7 +62,7 @@
    * \param cellId the Physical Cell ID of the neighbouring cell of interest
    * \return if true, the Neighbour Relation shall *not* be removed from the NRT
    */
-  virtual bool GetNoRemove (uint16_t cellId) = 0;
+  virtual bool GetNoRemove (uint16_t cellId) const = 0;
 
   /**
    * \brief Get the value of *No HO* field of a neighbouring cell from the
@@ -71,7 +71,7 @@
    * \return if true, the Neighbour Relation shall *not* be used by the eNodeB
    *         for handover reasons
    */
-  virtual bool GetNoHo (uint16_t cellId) = 0;
+  virtual bool GetNoHo (uint16_t cellId) const = 0;
 
   /**
    * \brief Get the value of *No X2* field of a neighbouring cell from the
@@ -81,7 +81,7 @@
    *         order to initiate procedures towards the eNodeB parenting the
    *         target cell
    */
-  virtual bool GetNoX2 (uint16_t cellId) = 0;
+  virtual bool GetNoX2 (uint16_t cellId) const = 0;
 
 }; // end of class LteAnrSapProvider
 
@@ -133,9 +133,9 @@
   // inherited from LteAnrSapProvider
   virtual void ReportUeMeas (LteRrcSap::MeasResults measResults);
   virtual void AddNeighbourRelation (uint16_t cellId);
-  virtual bool GetNoRemove (uint16_t cellId);
-  virtual bool GetNoHo (uint16_t cellId);
-  virtual bool GetNoX2 (uint16_t cellId);
+  virtual bool GetNoRemove (uint16_t cellId) const;
+  virtual bool GetNoHo (uint16_t cellId) const;
+  virtual bool GetNoX2 (uint16_t cellId) const;
 
 private:
   MemberLteAnrSapProvider ();
@@ -169,7 +169,7 @@
 
 template <class C>
 bool
-MemberLteAnrSapProvider<C>::GetNoRemove (uint16_t cellId)
+MemberLteAnrSapProvider<C>::GetNoRemove (uint16_t cellId) const
 {
   return m_owner->DoGetNoRemove (cellId);
 }
@@ -177,7 +177,7 @@
 
 template <class C>
 bool
-MemberLteAnrSapProvider<C>::GetNoHo (uint16_t cellId)
+MemberLteAnrSapProvider<C>::GetNoHo (uint16_t cellId) const
 {
   return m_owner->DoGetNoHo (cellId);
 }
@@ -185,7 +185,7 @@
 
 template <class C>
 bool
-MemberLteAnrSapProvider<C>::GetNoX2 (uint16_t cellId)
+MemberLteAnrSapProvider<C>::GetNoX2 (uint16_t cellId) const
 {
   return m_owner->DoGetNoX2 (cellId);
 }
--- a/src/lte/model/lte-anr.cc	Thu Sep 26 12:28:49 2013 +0300
+++ b/src/lte/model/lte-anr.cc	Thu Sep 26 13:22:58 2013 +0300
@@ -218,7 +218,7 @@
 
 
 bool
-LteAnr::DoGetNoRemove (uint16_t cellId)
+LteAnr::DoGetNoRemove (uint16_t cellId) const
 {
   NS_LOG_FUNCTION (this << m_servingCellId << cellId);
   return Find (cellId)->noRemove;
@@ -226,7 +226,7 @@
 
 
 bool
-LteAnr::DoGetNoHo (uint16_t cellId)
+LteAnr::DoGetNoHo (uint16_t cellId) const
 {
   NS_LOG_FUNCTION (this << m_servingCellId << cellId);
   return Find (cellId)->noHo;
@@ -234,17 +234,17 @@
 
 
 bool
-LteAnr::DoGetNoX2 (uint16_t cellId)
+LteAnr::DoGetNoX2 (uint16_t cellId) const
 {
   NS_LOG_FUNCTION (this << m_servingCellId << cellId);
   return Find (cellId)->noX2;
 }
 
 
-LteAnr::NeighbourRelation_t *
-LteAnr::Find (uint16_t cellId)
+const LteAnr::NeighbourRelation_t *
+LteAnr::Find (uint16_t cellId) const
 {
-  NeighbourRelationTable_t::iterator it = m_neighbourRelationTable.find (cellId);
+  NeighbourRelationTable_t::const_iterator it = m_neighbourRelationTable.find (cellId);
   if (it == m_neighbourRelationTable.end ())
     {
       NS_FATAL_ERROR ("Cell ID " << cellId << " cannot be found in NRT");
--- a/src/lte/model/lte-anr.h	Thu Sep 26 12:28:49 2013 +0300
+++ b/src/lte/model/lte-anr.h	Thu Sep 26 13:22:58 2013 +0300
@@ -97,9 +97,9 @@
   // ANR SAP provider implementation
   void DoReportUeMeas (LteRrcSap::MeasResults measResults);
   void DoAddNeighbourRelation (uint16_t cellId);
-  bool DoGetNoRemove (uint16_t cellId);
-  bool DoGetNoHo (uint16_t cellId);
-  bool DoGetNoX2 (uint16_t cellId);
+  bool DoGetNoRemove (uint16_t cellId) const;
+  bool DoGetNoHo (uint16_t cellId) const;
+  bool DoGetNoX2 (uint16_t cellId) const;
 
   // ANR SAPs
   LteAnrSapUser* m_anrSapUser;
@@ -126,7 +126,7 @@
   NeighbourRelationTable_t m_neighbourRelationTable;
 
   // internal methods
-  NeighbourRelation_t* Find (uint16_t cellId);
+  const NeighbourRelation_t* Find (uint16_t cellId) const;
 
   // The expected measurement identity
   uint8_t m_measId;
--- a/src/lte/model/lte-enb-rrc.cc	Thu Sep 26 12:28:49 2013 +0300
+++ b/src/lte/model/lte-enb-rrc.cc	Thu Sep 26 13:22:58 2013 +0300
@@ -994,19 +994,19 @@
 
 
 uint16_t
-UeManager::GetRnti (void)
+UeManager::GetRnti (void) const
 {
   return m_rnti;
 }
 
 uint64_t
-UeManager::GetImsi (void)
+UeManager::GetImsi (void) const
 {
   return m_imsi;
 }
 
 uint16_t
-UeManager::GetSrsConfigurationIndex (void)
+UeManager::GetSrsConfigurationIndex (void) const
 {
   return m_physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex;
 }
@@ -1031,7 +1031,7 @@
 }
 
 UeManager::State
-UeManager::GetState (void)
+UeManager::GetState (void) const
 {
   return m_state;
 }
--- a/src/lte/model/lte-enb-rrc.h	Thu Sep 26 12:28:49 2013 +0300
+++ b/src/lte/model/lte-enb-rrc.h	Thu Sep 26 13:22:58 2013 +0300
@@ -257,19 +257,19 @@
    * \return the RNTI, i.e., an UE identifier that is unique within
    * the cell
    */
-  uint16_t GetRnti (void);
+  uint16_t GetRnti (void) const;
 
   /** 
    *
    * \return the IMSI, i.e., a globally unique UE identifier
    */
-  uint64_t GetImsi (void);
+  uint64_t GetImsi (void) const;
 
   /** 
    * 
    * \return the SRS Configuration Index
    */
-  uint16_t GetSrsConfigurationIndex (void);  
+  uint16_t GetSrsConfigurationIndex (void) const;
 
   /** 
    * Set the SRS configuration index and do the necessary reconfiguration
@@ -282,7 +282,7 @@
    * 
    * \return the current state
    */
-  State GetState ();
+  State GetState () const;
 
 
 private:
--- a/src/lte/model/lte-ue-phy.cc	Thu Sep 26 12:28:49 2013 +0300
+++ b/src/lte/model/lte-ue-phy.cc	Thu Sep 26 13:22:58 2013 +0300
@@ -1262,7 +1262,7 @@
 
 
 LteUePhy::State
-LteUePhy::GetState ()
+LteUePhy::GetState () const
 {
   NS_LOG_FUNCTION (this);
   return m_state;
--- a/src/lte/model/lte-ue-phy.h	Thu Sep 26 12:28:49 2013 +0300
+++ b/src/lte/model/lte-ue-phy.h	Thu Sep 26 13:22:58 2013 +0300
@@ -224,7 +224,7 @@
   /**
    * \return The current state
    */
-  State GetState ();
+  State GetState () const;
 
 
 
--- a/src/lte/model/lte-ue-rrc.cc	Thu Sep 26 12:28:49 2013 +0300
+++ b/src/lte/model/lte-ue-rrc.cc	Thu Sep 26 13:22:58 2013 +0300
@@ -302,7 +302,7 @@
 }
 
 uint64_t
-LteUeRrc::GetImsi (void)
+LteUeRrc::GetImsi (void) const
 {
   return m_imsi;
 }
@@ -350,7 +350,7 @@
 }
 
 LteUeRrc::State
-LteUeRrc::GetState (void)
+LteUeRrc::GetState (void) const
 {
   NS_LOG_FUNCTION (this);
   return m_state;
--- a/src/lte/model/lte-ue-rrc.h	Thu Sep 26 12:28:49 2013 +0300
+++ b/src/lte/model/lte-ue-rrc.h	Thu Sep 26 13:22:58 2013 +0300
@@ -199,8 +199,7 @@
    *
    * \return imsi the unique UE identifier
    */
-  uint64_t GetImsi (void);
-
+  uint64_t GetImsi (void) const;
 
   /**
    *
@@ -208,14 +207,12 @@
    */
   uint16_t GetRnti () const;
 
-
   /**
    *
    * \return the CellId of the attached Enb
    */
   uint16_t GetCellId () const;
 
-
   /** 
    * \return the uplink bandwidth in RBs
    */
@@ -240,7 +237,7 @@
    *
    * \return the current state
    */
-  State GetState ();
+  State GetState () const;
 
   /** 
    *