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 {
32 }
33 
35 {
36 }
37 
38 TypeId
40 {
41  static TypeId tid = TypeId ("ns3::LteUeComponentCarrierManager")
42  .SetParent<Object> ()
43  .SetGroupName("Lte");
44  return tid;
45 }
46 
47 void
49 {
50 }
51 
52 bool
54 {
55  NS_LOG_FUNCTION (this);
56  bool result = false;
57  std::map <uint8_t, LteMacSapProvider*>::iterator it;
58  it=m_macSapProvidersMap.find (componentCarrierId);
59  if (componentCarrierId > m_noOfComponentCarriers)
60  {
61  NS_FATAL_ERROR ("Inconsistent componentCarrierId or you didn't call SetNumberOfComponentCarriers before calling this method");
62  }
63  if (it != m_macSapProvidersMap.end ())
64  {
65  NS_FATAL_ERROR ("Tried to allocated an existing componentCarrierId");
66  }
67  else
68  {
69  m_macSapProvidersMap.insert (std::pair<uint8_t, LteMacSapProvider*>(componentCarrierId, sap));
70  result = true;
71  }
72  return result;
73 
74 }
75 
76 void
78 {
79  NS_LOG_FUNCTION (this);
80  m_noOfComponentCarriers = noOfComponentCarriers;
81 }
82 
83 
84 } // end of namespace ns3
bool SetComponentCarrierMacSapProviders(uint8_t componentCarrierId, LteMacSapProvider *sap)
Sets a pointer to SAP interface of MAC instance for the specified carrier.
#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 NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
void SetNumberOfComponentCarriers(uint8_t noOfComponentCarriers)
Sets number of component carriers that are supported by this UE.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::map< uint8_t, LteMacSapProvider * > m_macSapProvidersMap
Map of pointers to SAP to interfaces of the MAC instance if the flows of this UE. ...
virtual void DoDispose()
Destructor implementation.
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:36
A base class which provides memory management and object aggregation.
Definition: object.h:87
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:915
uint16_t m_noOfComponentCarriers
// The number of component carriers that this UE can support.