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 
91  // inherited from Object
92  static TypeId GetTypeId ();
93 
108  void AddNeighbourRelation (uint16_t cellId);
109 
118  void RemoveNeighbourRelation (uint16_t cellId);
119 
126  virtual void SetLteAnrSapUser (LteAnrSapUser* s);
127 
134 
135  // let the forwarder class access the protected and private members
137 
138 protected:
139  // inherited from Object
140  virtual void DoInitialize ();
141  virtual void DoDispose ();
142 
143 private:
144 
145  // ANR SAP PROVIDER IMPLEMENTATION
146 
151  void DoReportUeMeas (LteRrcSap::MeasResults measResults);
152 
157  void DoAddNeighbourRelation (uint16_t cellId);
158 
164  bool DoGetNoRemove (uint16_t cellId) const;
165 
172  bool DoGetNoHo (uint16_t cellId) const;
173 
181  bool DoGetNoX2 (uint16_t cellId) const;
182 
183  // ANR SAP
184 
190 
196 
197  // ATTRIBUTE
198 
200  uint8_t m_threshold;
201 
207  {
208  bool noRemove;
209  bool noHo;
210  bool noX2;
212  };
213 
214  // cellId
215  typedef std::map<uint16_t, NeighbourRelation_t> NeighbourRelationTable_t;
216 
217  NeighbourRelationTable_t m_neighbourRelationTable;
218 
219  // internal methods
220  const NeighbourRelation_t* Find (uint16_t cellId) const;
221 
222  // The expected measurement identity
223  uint8_t m_measId;
224 
225  uint16_t m_servingCellId;
226 
227 }; // end of class LteAnr
228 
229 
230 } // end of namespace ns3
231 
232 
233 #endif /* LTE_ANR_H */
uint8_t m_threshold
The attribute Threshold.
Definition: lte-anr.h:200
virtual void DoInitialize()
Initialize() implementation.
Definition: lte-anr.cc:128
const NeighbourRelation_t * Find(uint16_t cellId) const
Definition: lte-anr.cc:252
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:189
std::map< uint16_t, NeighbourRelation_t > NeighbourRelationTable_t
Definition: lte-anr.h:215
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
Definition: lte-anr.h:225
bool DoGetNoX2(uint16_t cellId) const
Implementation of LteAnrSapProvider::GetNoX2.
Definition: lte-anr.cc:244
Neighbour Relation between two eNodeBs (serving eNodeB and neighbour eNodeB).
Definition: lte-anr.h:206
Service Access Point (SAP) offered by the eNodeB RRC instance to the ANR instance.
Definition: lte-anr-sap.h:97
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
Definition: lte-anr.h:223
LteAnr(uint16_t servingCellId)
Creates an ANR instance.
Definition: lte-anr.cc:39
bool DoGetNoRemove(uint16_t cellId) const
Implementation of LteAnrSapProvider::GetNoRemove.
Definition: lte-anr.cc:228
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
A base class which provides memory management and object aggregation.
Definition: object.h:87
static TypeId GetTypeId()
Definition: lte-anr.cc:57
a unique identifier for an interface.
Definition: type-id.h:58
bool DoGetNoHo(uint16_t cellId) const
Implementation of LteAnrSapProvider::GetNoHo.
Definition: lte-anr.cc:236
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:195
NeighbourRelationTable_t m_neighbourRelationTable
Definition: lte-anr.h:217
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