A Discrete-Event Network Simulator
API
lte-enb-component-carrier-manager.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2015 Danilo Abrignani
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Danilo Abrignani <danilo.abrignani@unibo.it>
19  *
20  */
21 
23 #include <ns3/log.h>
24 
25 namespace ns3 {
26 
27 NS_LOG_COMPONENT_DEFINE ("LteEnbComponentCarrierManager");
28 NS_OBJECT_ENSURE_REGISTERED (LteEnbComponentCarrierManager);
29 
30 
32 {
33 
34 }
35 
37 {
38 }
39 
40 TypeId
42 {
43  static TypeId tid = TypeId ("ns3::LteEnbComponentCarrierManager")
44  .SetParent<Object> ()
45  .SetGroupName("Lte")
46  ;
47  return tid;
48 }
49 
50 void
52 {
53 }
54 
55 void
57 {
58  NS_LOG_FUNCTION (this << s);
59  m_ccmRrcSapUser = s;
60 }
61 
64 {
65  NS_LOG_FUNCTION (this);
66  return m_ccmRrcSapProvider;
67 }
68 
71 {
72  NS_LOG_FUNCTION (this);
73  return m_macSapProvider;
74 }
75 
78 {
79  NS_LOG_FUNCTION (this);
80  return m_ccmMacSapUser;
81 }
82 
83 bool
85 {
86  NS_LOG_FUNCTION (this);
87  bool res = false;
88  std::map <uint8_t, LteMacSapProvider*>::iterator it = m_macSapProvidersMap.find (componentCarrierId);
89  if ((uint16_t) componentCarrierId > m_noOfComponentCarriers)
90  {
91  NS_FATAL_ERROR ("Inconsistent componentCarrierId or you didn't call SetNumberOfComponentCarriers before calling this method");
92  }
93  if (it != m_macSapProvidersMap.end ())
94  {
95  NS_FATAL_ERROR ("Tried to allocated an existing componentCarrierId");
96  }
97  else
98  {
99  m_macSapProvidersMap.insert (std::pair<uint8_t, LteMacSapProvider*>(componentCarrierId, sap));
100  res = true;
101  }
102  return res;
103 
104 }
105 
106 bool
108 {
109  NS_LOG_FUNCTION (this);
110  bool res = false;
111  std::map< uint8_t,LteCcmMacSapProvider*>::iterator it = m_ccmMacSapProviderMap.find (componentCarrierId);
112 
113  if (it == m_ccmMacSapProviderMap.end ())
114  {
115  m_ccmMacSapProviderMap.insert (std::pair <uint8_t,LteCcmMacSapProvider*> (componentCarrierId, sap));
116  }
117 
118  res = true;
119  return res;
120 
121 }
122 
123 void
125 {
126  NS_LOG_FUNCTION (this);
127  NS_ABORT_MSG_IF (noOfComponentCarriers < MIN_NO_CC || noOfComponentCarriers > MAX_NO_CC, "Number of component carriers should be greater than 0 and less than 6");
128  m_noOfComponentCarriers = noOfComponentCarriers;
129  //Set the number of component carriers in eNB RRC
130  m_ccmRrcSapUser->SetNumberOfComponentCarriers (noOfComponentCarriers);
131 }
132 
133 } // end of namespace ns3
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
ns3::LteMacSapProvider
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:37
ns3::LteEnbComponentCarrierManager::DoDispose
virtual void DoDispose()
Destructor implementation.
Definition: lte-enb-component-carrier-manager.cc:51
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::LteCcmRrcSapProvider
Service Access Point (SAP) offered by the Component Carrier Manager (CCM) instance to the eNodeB RRC ...
Definition: lte-ccm-rrc-sap.h:47
ns3::LteEnbComponentCarrierManager::SetNumberOfComponentCarriers
virtual void SetNumberOfComponentCarriers(uint16_t noOfComponentCarriers)
Sets the total number of component carriers.
Definition: lte-enb-component-carrier-manager.cc:124
ns3::LteEnbComponentCarrierManager::SetLteCcmRrcSapUser
virtual void SetLteCcmRrcSapUser(LteCcmRrcSapUser *s)
Set the "user" part of the ComponentCarrier Management SAP interface that this ComponentCarrier algor...
Definition: lte-enb-component-carrier-manager.cc:56
ns3::LteEnbComponentCarrierManager::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition: lte-enb-component-carrier-manager.cc:41
ns3::LteEnbComponentCarrierManager::SetMacSapProvider
virtual bool SetMacSapProvider(uint8_t componentCarrierId, LteMacSapProvider *sap)
Set LteMacSapProvider interface for the MAC object of the specified component carrier.
Definition: lte-enb-component-carrier-manager.cc:84
ns3::LteEnbComponentCarrierManager::m_ccmRrcSapProvider
LteCcmRrcSapProvider * m_ccmRrcSapProvider
A pointer to the SAP interface of the CCM instance to receive API calls from the eNodeB RRC instance.
Definition: lte-enb-component-carrier-manager.h:203
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
ns3::LteCcmRrcSapUser
Service Access Point (SAP) offered by the eNodeB RRC instance to the component carrier manager (CCM) ...
Definition: lte-ccm-rrc-sap.h:152
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
ns3::LteEnbComponentCarrierManager::m_ccmMacSapProviderMap
std::map< uint8_t, LteCcmMacSapProvider * > m_ccmMacSapProviderMap
A map of pointers to the SAP interfaces of CCM instance that provides the CCM specific functionalitie...
Definition: lte-enb-component-carrier-manager.h:200
ns3::Object
A base class which provides memory management and object aggregation.
Definition: object.h:88
lte-enb-component-carrier-manager.h
ns3::LteEnbComponentCarrierManager::SetCcmMacSapProviders
virtual bool SetCcmMacSapProviders(uint8_t componentCarrierId, LteCcmMacSapProvider *sap)
Set LteCcmMacSapProvider interface for the MAC object of the specified component carrier.
Definition: lte-enb-component-carrier-manager.cc:107
ns3::LteEnbComponentCarrierManager::m_ccmRrcSapUser
LteCcmRrcSapUser * m_ccmRrcSapUser
A pointer to SAP interface of RRC instance, i.e.
Definition: lte-enb-component-carrier-manager.h:202
NS_ABORT_MSG_IF
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
ns3::LteEnbComponentCarrierManager::m_noOfComponentCarriers
uint16_t m_noOfComponentCarriers
The number component of carriers that are supported by this eNb.
Definition: lte-enb-component-carrier-manager.h:172
ns3::LteEnbComponentCarrierManager::GetLteCcmRrcSapProvider
virtual LteCcmRrcSapProvider * GetLteCcmRrcSapProvider()
Export the "provider" part of the ComponentCarrier Management SAP interface.
Definition: lte-enb-component-carrier-manager.cc:63
ns3::LteEnbComponentCarrierManager::GetLteCcmMacSapUser
virtual LteCcmMacSapUser * GetLteCcmMacSapUser()
This function returns a pointer to the LteCcmMacSapUser interface, which is used by MAC to communicat...
Definition: lte-enb-component-carrier-manager.cc:77
ns3::LteEnbComponentCarrierManager::LteEnbComponentCarrierManager
LteEnbComponentCarrierManager()
Definition: lte-enb-component-carrier-manager.cc:31
ns3::LteEnbComponentCarrierManager::GetLteMacSapProvider
virtual LteMacSapProvider * GetLteMacSapProvider()
Returns the pointer to the LteMacSapProvider interface, the provider of MAC, which is this new archit...
Definition: lte-enb-component-carrier-manager.cc:70
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::LteEnbComponentCarrierManager::m_macSapProvidersMap
std::map< uint8_t, LteMacSapProvider * > m_macSapProvidersMap
A map of pointers to real SAP interfaces of MAC instances.
Definition: lte-enb-component-carrier-manager.h:192
ns3::LteCcmMacSapProvider
Service Access Point (SAP) offered by the component carrier manager (CCM) by MAC to CCM.
Definition: lte-ccm-mac-sap.h:44
ns3::LteEnbComponentCarrierManager::~LteEnbComponentCarrierManager
virtual ~LteEnbComponentCarrierManager()
Definition: lte-enb-component-carrier-manager.cc:36
ns3::LteEnbComponentCarrierManager::m_macSapProvider
LteMacSapProvider * m_macSapProvider
A pointer to main SAP interface of the MAC instance, which is in this case handled by CCM.
Definition: lte-enb-component-carrier-manager.h:188
ns3::LteEnbComponentCarrierManager::m_ccmMacSapUser
LteCcmMacSapUser * m_ccmMacSapUser
LteCcmMacSapUser is extended version of LteMacSapUser interface.
Definition: lte-enb-component-carrier-manager.h:201
ns3::LteCcmMacSapUser
Service Access Point (SAP) offered by MAC to the component carrier manager (CCM).
Definition: lte-ccm-mac-sap.h:79
MAX_NO_CC
#define MAX_NO_CC
Definition: lte-enb-rrc.h:57
ns3::LteCcmRrcSapUser::SetNumberOfComponentCarriers
virtual void SetNumberOfComponentCarriers(uint16_t noOfComponentCarriers)=0
Set the number of component carriers.