A Discrete-Event Network Simulator
API
lte-anr.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  * Copyright (c) 2013 Budiarto Herman
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Original work authors (from lte-enb-rrc.cc):
20  * - Nicola Baldo <nbaldo@cttc.es>
21  * - Marco Miozzo <mmiozzo@cttc.es>
22  * - Manuel Requena <manuel.requena@cttc.es>
23  *
24  * Converted to ANR interface by:
25  * - Budiarto Herman <budiarto.herman@magister.fi>
26  */
27 
28 #ifndef LTE_ANR_H
29 #define LTE_ANR_H
30 
31 #include <ns3/object.h>
32 #include <ns3/lte-rrc-sap.h>
33 #include <ns3/lte-anr-sap.h>
34 #include <map>
35 
36 namespace ns3 {
37 
38 
39 class LteAnrSapProvider;
40 class LteAnrSapUser;
41 class LteNeighbourRelation;
42 
80 class LteAnr : public Object
81 {
82 public:
88  LteAnr (uint16_t servingCellId);
89  virtual ~LteAnr ();
90 
95  static TypeId GetTypeId ();
96 
111  void AddNeighbourRelation (uint16_t cellId);
112 
121  void RemoveNeighbourRelation (uint16_t cellId);
122 
129  virtual void SetLteAnrSapUser (LteAnrSapUser* s);
130 
137 
140 
141 protected:
142  // inherited from Object
143  virtual void DoInitialize ();
144  virtual void DoDispose ();
145 
146 private:
147 
148  // ANR SAP PROVIDER IMPLEMENTATION
149 
154  void DoReportUeMeas (LteRrcSap::MeasResults measResults);
155 
160  void DoAddNeighbourRelation (uint16_t cellId);
161 
167  bool DoGetNoRemove (uint16_t cellId) const;
168 
175  bool DoGetNoHo (uint16_t cellId) const;
176 
184  bool DoGetNoX2 (uint16_t cellId) const;
185 
186  // ANR SAP
187 
193 
199 
200  // ATTRIBUTE
201 
203  uint8_t m_threshold;
204 
210  {
211  bool noRemove;
212  bool noHo;
213  bool noX2;
215  };
216 
218  typedef std::map<uint16_t, NeighbourRelation_t> NeighbourRelationTable_t;
219 
222 
228  const NeighbourRelation_t* Find (uint16_t cellId) const;
229 
231  uint8_t m_measId;
232 
234  uint16_t m_servingCellId;
235 
236 }; // end of class LteAnr
237 
238 
239 } // end of namespace ns3
240 
241 
242 #endif /* LTE_ANR_H */
uint8_t m_threshold
The attribute Threshold.
Definition: lte-anr.h:203
virtual void DoInitialize()
Initialize() implementation.
Definition: lte-anr.cc:128
void DoAddNeighbourRelation(uint16_t cellId)
Implementation of LteAnrSapProvider::AddNeighbourRelation.
Definition: lte-anr.cc:220
LteAnrSapProvider * m_anrSapProvider
Reference to the "provider" part of the ANR SAP interface, which is automatically created when this c...
Definition: lte-anr.h:192
std::map< uint16_t, NeighbourRelation_t > NeighbourRelationTable_t
cellId
Definition: lte-anr.h:218
virtual void DoDispose()
Destructor implementation.
Definition: lte-anr.cc:144
void AddNeighbourRelation(uint16_t cellId)
Provide an advance information about a related neighbouring cell and add it as a new Neighbour Relati...
Definition: lte-anr.cc:73
uint16_t m_servingCellId
Serving cell ID.
Definition: lte-anr.h:234
bool DoGetNoHo(uint16_t cellId) const
Implementation of LteAnrSapProvider::GetNoHo.
Definition: lte-anr.cc:236
const NeighbourRelation_t * Find(uint16_t cellId) const
Definition: lte-anr.cc:252
MeasResults structure.
Definition: lte-rrc-sap.h:671
bool DoGetNoRemove(uint16_t cellId) const
Implementation of LteAnrSapProvider::GetNoRemove.
Definition: lte-anr.cc:228
Neighbour Relation between two eNodeBs (serving eNodeB and neighbour eNodeB).
Definition: lte-anr.h:209
Service Access Point (SAP) offered by the eNodeB RRC instance to the ANR instance.
Definition: lte-anr-sap.h:97
bool detectedAsNeighbour
detected as neighbor
Definition: lte-anr.h:214
virtual void SetLteAnrSapUser(LteAnrSapUser *s)
Set the "user" part of the ANR SAP interface that this ANR instance will interact with...
Definition: lte-anr.cc:112
void RemoveNeighbourRelation(uint16_t cellId)
Remove an existing Neighbour Relation entry.
Definition: lte-anr.cc:97
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t m_measId
The expected measurement identity.
Definition: lte-anr.h:231
LteAnr(uint16_t servingCellId)
Creates an ANR instance.
Definition: lte-anr.cc:39
Service Access Point (SAP) offered by the ANR instance to the eNodeB RRC instance.
Definition: lte-anr-sap.h:37
virtual LteAnrSapProvider * GetLteAnrSapProvider()
Export the "provider" part of the ANR SAP interface.
Definition: lte-anr.cc:120
void DoReportUeMeas(LteRrcSap::MeasResults measResults)
Implementation of LteAnrSapProvider::ReportUeMeas.
Definition: lte-anr.cc:153
Automatic Neighbour Relation function.
Definition: lte-anr.h:80
bool DoGetNoX2(uint16_t cellId) const
Implementation of LteAnrSapProvider::GetNoX2.
Definition: lte-anr.cc:244
A base class which provides memory management and object aggregation.
Definition: object.h:87
static TypeId GetTypeId()
Get the type ID.
Definition: lte-anr.cc:57
a unique identifier for an interface.
Definition: type-id.h:58
LteAnrSapUser * m_anrSapUser
Reference to the "user" part of the ANR SAP interface, which is provided by the eNodeB RRC instance...
Definition: lte-anr.h:198
NeighbourRelationTable_t m_neighbourRelationTable
neighbor relation table
Definition: lte-anr.h:221
virtual ~LteAnr()
Definition: lte-anr.cc:50
Template for the implementation of the LteAnrSapProvider as a member of an owner class of type C to w...
Definition: lte-anr-sap.h:128