A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-enb-component-carrier-manager.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 Danilo Abrignani
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Danilo Abrignani <danilo.abrignani@unibo.it>
7 *
8 */
9
11
12#include "lte-common.h"
13
14#include <ns3/log.h>
15
16namespace ns3
17{
18
19NS_LOG_COMPONENT_DEFINE("LteEnbComponentCarrierManager");
20NS_OBJECT_ENSURE_REGISTERED(LteEnbComponentCarrierManager);
21
25
29
32{
33 static TypeId tid =
34 TypeId("ns3::LteEnbComponentCarrierManager").SetParent<Object>().SetGroupName("Lte");
35 return tid;
36}
37
38void
42
43void
49
56
63
70
71bool
73{
74 NS_LOG_FUNCTION(this);
75 bool res = false;
76 auto it = m_macSapProvidersMap.find(componentCarrierId);
77 if ((uint16_t)componentCarrierId > m_noOfComponentCarriers)
78 {
79 NS_FATAL_ERROR("Inconsistent componentCarrierId or you didn't call "
80 "SetNumberOfComponentCarriers before calling this method");
81 }
82 if (it != m_macSapProvidersMap.end())
83 {
84 NS_FATAL_ERROR("Tried to allocated an existing componentCarrierId");
85 }
86 else
87 {
89 std::pair<uint8_t, LteMacSapProvider*>(componentCarrierId, sap));
90 res = true;
91 }
92 return res;
93}
94
95bool
98{
99 NS_LOG_FUNCTION(this);
100 bool res = false;
101 auto it = m_ccmMacSapProviderMap.find(componentCarrierId);
102
103 if (it == m_ccmMacSapProviderMap.end())
104 {
106 std::pair<uint8_t, LteCcmMacSapProvider*>(componentCarrierId, sap));
107 }
108
109 res = true;
110 return res;
111}
112
113void
115{
116 NS_LOG_FUNCTION(this);
117 NS_ABORT_MSG_IF(noOfComponentCarriers < MIN_NO_CC || noOfComponentCarriers > MAX_NO_CC,
118 "Number of component carriers should be greater than 0 and less than 6");
119 m_noOfComponentCarriers = noOfComponentCarriers;
120 // Set the number of component carriers in eNB RRC
121 m_ccmRrcSapUser->SetNumberOfComponentCarriers(noOfComponentCarriers);
122}
123
124} // end of namespace ns3
Service Access Point (SAP) offered by the component carrier manager (CCM) by MAC to CCM.
Service Access Point (SAP) offered by MAC to the component carrier manager (CCM).
Service Access Point (SAP) offered by the Component Carrier Manager (CCM) instance to the eNodeB RRC ...
Service Access Point (SAP) offered by the eNodeB RRC instance to the component carrier manager (CCM) ...
virtual void SetNumberOfComponentCarriers(uint16_t noOfComponentCarriers)=0
Set the number of component carriers.
virtual LteCcmMacSapUser * GetLteCcmMacSapUser()
This function returns a pointer to the LteCcmMacSapUser interface, which is used by MAC to communicat...
LteCcmRrcSapProvider * m_ccmRrcSapProvider
A pointer to the SAP interface of the CCM instance to receive API calls from the eNodeB RRC instance.
virtual LteMacSapProvider * GetLteMacSapProvider()
Returns the pointer to the LteMacSapProvider interface, the provider of MAC, which is this new archit...
LteMacSapProvider * m_macSapProvider
A pointer to main SAP interface of the MAC instance, which is in this case handled by CCM.
std::map< uint8_t, LteMacSapProvider * > m_macSapProvidersMap
A map of pointers to real SAP interfaces of MAC instances.
virtual LteCcmRrcSapProvider * GetLteCcmRrcSapProvider()
Export the "provider" part of the ComponentCarrier Management SAP interface.
virtual bool SetMacSapProvider(uint8_t componentCarrierId, LteMacSapProvider *sap)
Set LteMacSapProvider interface for the MAC object of the specified component carrier.
virtual void SetNumberOfComponentCarriers(uint16_t noOfComponentCarriers)
Sets the total number of component carriers.
void DoDispose() override
Destructor implementation.
uint16_t m_noOfComponentCarriers
The number component of carriers that are supported by this eNb.
std::map< uint8_t, LteCcmMacSapProvider * > m_ccmMacSapProviderMap
A map of pointers to the SAP interfaces of CCM instance that provides the CCM specific functionalitie...
virtual bool SetCcmMacSapProviders(uint8_t componentCarrierId, LteCcmMacSapProvider *sap)
Set LteCcmMacSapProvider interface for the MAC object of the specified component carrier.
virtual void SetLteCcmRrcSapUser(LteCcmRrcSapUser *s)
Set the "user" part of the ComponentCarrier Management SAP interface that this ComponentCarrier algor...
LteCcmMacSapUser * m_ccmMacSapUser
LteCcmMacSapUser is extended version of LteMacSapUser interface.
LteCcmRrcSapUser * m_ccmRrcSapUser
A pointer to SAP interface of RRC instance, i.e.
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition lte-mac-sap.h:25
A base class which provides memory management and object aggregation.
Definition object.h:78
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition abort.h:97
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.
constexpr uint32_t MAX_NO_CC
Maximum number of carrier components allowed by 3GPP up to R13.
Definition lte-common.h:28