A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
lte
model
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
22
#include "
lte-ue-component-carrier-manager.h
"
23
#include <ns3/log.h>
24
25
namespace
ns3
{
26
27
NS_LOG_COMPONENT_DEFINE
(
"LteUeComponentCarrierManager"
);
28
NS_OBJECT_ENSURE_REGISTERED
(LteUeComponentCarrierManager);
29
30
LteUeComponentCarrierManager::LteUeComponentCarrierManager
()
31
{
32
}
33
34
LteUeComponentCarrierManager::~LteUeComponentCarrierManager
()
35
{
36
}
37
38
TypeId
39
LteUeComponentCarrierManager::GetTypeId
()
40
{
41
static
TypeId
tid =
TypeId
(
"ns3::LteUeComponentCarrierManager"
)
42
.
SetParent
<
Object
> ()
43
.SetGroupName(
"Lte"
);
44
return
tid;
45
}
46
47
void
48
LteUeComponentCarrierManager::DoDispose
()
49
{
50
}
51
52
bool
53
LteUeComponentCarrierManager::SetComponentCarrierMacSapProviders
(uint8_t componentCarrierId,
LteMacSapProvider
* sap)
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
77
LteUeComponentCarrierManager::SetNumberOfComponentCarriers
(uint8_t noOfComponentCarriers)
78
{
79
NS_LOG_FUNCTION
(
this
);
80
m_noOfComponentCarriers
= noOfComponentCarriers;
81
}
82
83
84
}
// end of namespace ns3
ns3::LteUeComponentCarrierManager::SetComponentCarrierMacSapProviders
bool SetComponentCarrierMacSapProviders(uint8_t componentCarrierId, LteMacSapProvider *sap)
Sets a pointer to SAP interface of MAC instance for the specified carrier.
Definition:
lte-ue-component-carrier-manager.cc:53
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:213
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:45
lte-ue-component-carrier-manager.h
ns3::LteUeComponentCarrierManager::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
lte-ue-component-carrier-manager.cc:39
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition:
log.h:202
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition:
fatal-error.h:162
ns3::LteUeComponentCarrierManager::LteUeComponentCarrierManager
LteUeComponentCarrierManager()
Definition:
lte-ue-component-carrier-manager.cc:30
ns3::LteUeComponentCarrierManager::~LteUeComponentCarrierManager
virtual ~LteUeComponentCarrierManager()
Definition:
lte-ue-component-carrier-manager.cc:34
ns3::LteUeComponentCarrierManager::SetNumberOfComponentCarriers
void SetNumberOfComponentCarriers(uint8_t noOfComponentCarriers)
Sets number of component carriers that are supported by this UE.
Definition:
lte-ue-component-carrier-manager.cc:77
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::LteUeComponentCarrierManager::m_macSapProvidersMap
std::map< uint8_t, LteMacSapProvider * > m_macSapProvidersMap
Map of pointers to SAP to interfaces of the MAC instance if the flows of this UE. ...
Definition:
lte-ue-component-carrier-manager.h:105
ns3::LteUeComponentCarrierManager::DoDispose
virtual void DoDispose()
Destructor implementation.
Definition:
lte-ue-component-carrier-manager.cc:48
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:36
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:87
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:915
ns3::LteUeComponentCarrierManager::m_noOfComponentCarriers
uint16_t m_noOfComponentCarriers
// The number of component carriers that this UE can support.
Definition:
lte-ue-component-carrier-manager.h:103
Generated on Wed Nov 7 2018 10:02:01 for ns-3 by
1.8.14