A Discrete-Event Network Simulator
API
lte-ue-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 ("LteUeComponentCarrierManager");
28 NS_OBJECT_ENSURE_REGISTERED (LteUeComponentCarrierManager);
29 
31 : m_ccmRrcSapUser (0), m_ccmRrcSapProvider (0), m_noOfComponentCarriers(0)
32 {
33  NS_LOG_FUNCTION (this);
34 }
35 
37 {
38  NS_LOG_FUNCTION (this);
39 }
40 
41 TypeId
43 {
44  static TypeId tid = TypeId ("ns3::LteUeComponentCarrierManager")
45  .SetParent<Object> ()
46  .SetGroupName("Lte");
47  return tid;
48 }
49 
50 void
52 {
53  NS_LOG_FUNCTION (this);
54 }
55 
56 void
58 {
59  NS_LOG_FUNCTION (this << s);
60  m_ccmRrcSapUser = s;
61 }
62 
65 {
66  NS_LOG_FUNCTION (this);
67  return m_ccmRrcSapProvider;
68 }
69 
70 
71 bool
73 {
74  NS_LOG_FUNCTION (this);
75  bool result = false;
76  std::map <uint8_t, LteMacSapProvider*>::iterator it;
77  it=m_macSapProvidersMap.find (componentCarrierId);
78  if (componentCarrierId > m_noOfComponentCarriers)
79  {
80  NS_FATAL_ERROR ("Inconsistent componentCarrierId or you didn't call 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  {
88  m_macSapProvidersMap.insert (std::pair<uint8_t, LteMacSapProvider*>(componentCarrierId, sap));
89  result = true;
90  }
91  return result;
92 
93 }
94 
95 void
97 {
98  NS_LOG_FUNCTION (this);
99  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");
100  m_noOfComponentCarriers = noOfComponentCarriers;
101  //Set the number of component carriers in UE RRC
102  m_ccmRrcSapUser->SetNumberOfComponentCarriers(noOfComponentCarriers);
103 }
104 
105 
106 } // end of namespace ns3
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:37
Service Access Point (SAP) offered by the UE component carrier manager to the UE RRC.
Service Access Point (SAP) offered by the UE RRC to the UE CCM.
virtual void SetNumberOfComponentCarriers(uint16_t noOfComponentCarriers)=0
Set the number of component carriers.
LteUeCcmRrcSapProvider * m_ccmRrcSapProvider
Receive API calls from the UE RRC instance.
void SetNumberOfComponentCarriers(uint8_t noOfComponentCarriers)
Sets number of component carriers that are supported by this UE.
std::map< uint8_t, LteMacSapProvider * > m_macSapProvidersMap
Map of pointers to SAP to interfaces of the MAC instance if the flows of this UE.
uint8_t m_noOfComponentCarriers
The number of component carriers that this UE can support.
virtual void SetLteCcmRrcSapUser(LteUeCcmRrcSapUser *s)
Set the "user" part of the ComponentCarrier Management SAP interface that this UE component carrier m...
LteUeCcmRrcSapUser * m_ccmRrcSapUser
Interface to the UE RRC instance.
virtual LteUeCcmRrcSapProvider * GetLteCcmRrcSapProvider()
Exports the "provider" part of the ComponentCarrier Management SAP interface.
virtual void DoDispose()
Destructor implementation.
bool SetComponentCarrierMacSapProviders(uint8_t componentCarrierId, LteMacSapProvider *sap)
Sets a pointer to SAP interface of MAC instance for the specified carrier.
A base class which provides memory management and object aggregation.
Definition: object.h:88
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:922
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
#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:45
#define MAX_NO_CC
Definition: lte-enb-rrc.h:57
Every class exported by the ns3 library is enclosed in the ns3 namespace.