BareHandoverAlgorithm for LTE to simulate absence of handover algorithm
authorBudiarto Herman <budiarto.herman@magister.fi>
Wed, 07 Aug 2013 15:34:24 +0300
changeset 10317 5792d2ae1cd4
parent 10316 dc88a59d7ff2
child 10318 d786d7b0bd16
BareHandoverAlgorithm for LTE to simulate absence of handover algorithm
src/lte/helper/lte-helper.cc
src/lte/model/a2-rsrq-handover-algorithm.cc
src/lte/model/handover-algorithm.cc
src/lte/model/handover-algorithm.h
--- a/src/lte/helper/lte-helper.cc	Wed Aug 07 11:42:53 2013 +0300
+++ b/src/lte/helper/lte-helper.cc	Wed Aug 07 15:34:24 2013 +0300
@@ -150,7 +150,7 @@
                    "The type of handover algorithm to be used for eNBs. "
                    "The allowed values for this attributes are the type names "
                    "of any class inheriting from ns3::HandoverAlgorithm.",
-                   StringValue ("ns3::A2RsrqHandoverAlgorithm"),
+                   StringValue ("ns3::BareHandoverAlgorithm"),
                    MakeStringAccessor (&LteHelper::SetHandoverAlgorithmType),
                    MakeStringChecker ())
     .AddAttribute ("PathlossModel",
--- a/src/lte/model/a2-rsrq-handover-algorithm.cc	Wed Aug 07 11:42:53 2013 +0300
+++ b/src/lte/model/a2-rsrq-handover-algorithm.cc	Wed Aug 07 15:34:24 2013 +0300
@@ -38,7 +38,8 @@
 ///////////////////////////////////////////
 
 /**
- * \brief Class for forwarding Handover Management SAP Provider functions.
+ * \brief Class for forwarding Handover Management SAP Provider functions, used
+ *        by ns3::A2RsrqHandoverAlgorithm.
  */
 class A2RsrqMemberHandoverManagementSapProvider : public HandoverManagementSapProvider
 {
--- a/src/lte/model/handover-algorithm.cc	Wed Aug 07 11:42:53 2013 +0300
+++ b/src/lte/model/handover-algorithm.cc	Wed Aug 07 15:34:24 2013 +0300
@@ -20,6 +20,7 @@
  */
 
 #include "handover-algorithm.h"
+#include <ns3/handover-management-sap.h>
 #include <ns3/log.h>
 
 NS_LOG_COMPONENT_DEFINE ("HandoverAlgorithm");
@@ -55,4 +56,106 @@
 }
 
 
+
+///////////////////////////////////////////
+// Handover Management SAP forwarder
+///////////////////////////////////////////
+
+NS_OBJECT_ENSURE_REGISTERED (BareHandoverAlgorithm);
+
+
+/**
+ * \brief Class for forwarding Handover Management SAP Provider functions, used
+ *        by ns3::BareHandoverAlgorithm.
+ */
+class BareMemberHandoverManagementSapProvider : public HandoverManagementSapProvider
+{
+public:
+  BareMemberHandoverManagementSapProvider (BareHandoverAlgorithm* handoverAlgorithm);
+
+  // methods inherited from HandoverManagementSapProvider go here
+  virtual void ReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
+
+private:
+  BareHandoverAlgorithm* m_handoverAlgorithm;
+};
+
+BareMemberHandoverManagementSapProvider::BareMemberHandoverManagementSapProvider (BareHandoverAlgorithm* handoverAlgorithm)
+  : m_handoverAlgorithm (handoverAlgorithm)
+{
+}
+
+void
+BareMemberHandoverManagementSapProvider::ReportUeMeas (uint16_t rnti,
+                                                       LteRrcSap::MeasResults measResults)
+{
+  m_handoverAlgorithm->DoReportUeMeas (rnti, measResults);
+}
+
+
+
+///////////////////////////////////////////
+// Bare Handover Algorithm
+///////////////////////////////////////////
+
+
+BareHandoverAlgorithm::BareHandoverAlgorithm ()
+  : m_handoverManagementSapUser (0)
+{
+  m_handoverManagementSapProvider = new BareMemberHandoverManagementSapProvider (this);
+}
+
+
+BareHandoverAlgorithm::~BareHandoverAlgorithm ()
+{
+}
+
+
+void
+BareHandoverAlgorithm::DoDispose ()
+{
+  delete m_handoverManagementSapProvider;
+}
+
+
+TypeId
+BareHandoverAlgorithm::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::BareHandoverAlgorithm")
+    .SetParent<HandoverAlgorithm> ()
+    .AddConstructor<BareHandoverAlgorithm> ()
+  ;
+  return tid;
+}
+
+
+void
+BareHandoverAlgorithm::SetHandoverManagementSapUser (HandoverManagementSapUser* s)
+{
+  m_handoverManagementSapUser = s;
+}
+
+
+HandoverManagementSapProvider*
+BareHandoverAlgorithm::GetHandoverManagementSapProvider ()
+{
+  return m_handoverManagementSapProvider;
+}
+
+
+void
+BareHandoverAlgorithm::DoInitialize ()
+{
+  HandoverAlgorithm::DoInitialize ();
+}
+
+
+void
+BareHandoverAlgorithm::DoReportUeMeas (uint16_t rnti,
+                                       LteRrcSap::MeasResults measResults)
+{
+}
+
+
+
 } // end of namespace ns3
--- a/src/lte/model/handover-algorithm.h	Wed Aug 07 11:42:53 2013 +0300
+++ b/src/lte/model/handover-algorithm.h	Wed Aug 07 15:34:24 2013 +0300
@@ -23,6 +23,7 @@
 #define HANDOVER_ALGORITHM_H
 
 #include <ns3/object.h>
+#include <ns3/lte-rrc-sap.h>
 
 namespace ns3 {
 
@@ -63,6 +64,44 @@
 }; // end of class HandoverAlgorithm
 
 
+
+/**
+ * \brief A sample implementation of the Handover Management SAP which simply
+ *        does nothing.
+ */
+class BareHandoverAlgorithm : public HandoverAlgorithm
+{
+public:
+  BareHandoverAlgorithm ();
+  virtual ~BareHandoverAlgorithm ();
+
+  // inherited from Object
+  virtual void DoDispose (void);
+  static TypeId GetTypeId (void);
+
+  // inherited from HandoverAlgorithm
+  virtual void SetHandoverManagementSapUser (HandoverManagementSapUser* s);
+  virtual HandoverManagementSapProvider* GetHandoverManagementSapProvider ();
+
+  friend class BareMemberHandoverManagementSapProvider;
+
+protected:
+  // inherited from Object
+  virtual void DoInitialize ();
+
+private:
+
+  // Handover Management SAP implementation
+  void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
+
+  // Handover Management SAPs
+  HandoverManagementSapUser* m_handoverManagementSapUser;
+  HandoverManagementSapProvider* m_handoverManagementSapProvider;
+
+}; // end of class BareHandoverAlgorithm
+
+
+
 } // end of namespace ns3