From d35b539d49fcd3596f8164849bf896aade049465 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Tue, 13 Jun 2017 12:50:27 +0300 Subject: [PATCH] lte: Add LteEnbNetDevice::HasCellId --- src/lte/model/lte-enb-net-device.cc | 13 +++++++++++++ src/lte/model/lte-enb-net-device.h | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/src/lte/model/lte-enb-net-device.cc b/src/lte/model/lte-enb-net-device.cc index 8b4c5d284..0b54d8e56 100644 --- a/src/lte/model/lte-enb-net-device.cc +++ b/src/lte/model/lte-enb-net-device.cc @@ -225,6 +225,19 @@ LteEnbNetDevice::GetCellId () const return m_cellId; } +bool +LteEnbNetDevice::HasCellId (uint16_t cellId) const +{ + for (auto &it: m_ccMap) + { + if (it.second->GetCellId () == cellId) + { + return true; + } + } + return false; +} + uint8_t LteEnbNetDevice::GetUlBandwidth () const { diff --git a/src/lte/model/lte-enb-net-device.h b/src/lte/model/lte-enb-net-device.h index 30d768c52..a90e624a7 100644 --- a/src/lte/model/lte-enb-net-device.h +++ b/src/lte/model/lte-enb-net-device.h @@ -107,6 +107,12 @@ public: */ uint16_t GetCellId () const; + /** + * \param cellId cell ID + * \return true if cellId is served by this eNB + */ + bool HasCellId (uint16_t cellId) const; + /** * \return the uplink bandwidth in RBs */