A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
component-carrier-enb.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
#include "
component-carrier-enb.h
"
22
#include <ns3/uinteger.h>
23
#include <ns3/boolean.h>
24
#include <ns3/simulator.h>
25
#include <ns3/log.h>
26
#include <ns3/abort.h>
27
#include <ns3/lte-enb-phy.h>
28
#include <ns3/pointer.h>
29
#include <ns3/lte-enb-mac.h>
30
#include <ns3/lte-ffr-algorithm.h>
31
#include <ns3/ff-mac-scheduler.h>
32
33
namespace
ns3
{
34
35
NS_LOG_COMPONENT_DEFINE
(
"ComponentCarrierEnb"
);
36
NS_OBJECT_ENSURE_REGISTERED
(ComponentCarrierEnb);
37
38
TypeId
ComponentCarrierEnb::GetTypeId
(
void
)
39
{
40
static
TypeId
41
tid =
42
TypeId
(
"ns3::ComponentCarrierEnb"
)
43
.
SetParent
<
ComponentCarrier
> ()
44
.AddConstructor<ComponentCarrierEnb> ()
45
.AddAttribute (
"LteEnbPhy"
,
46
"The PHY associated to this EnbNetDevice"
,
47
PointerValue
(),
48
MakePointerAccessor
(&
ComponentCarrierEnb::m_phy
),
49
MakePointerChecker <LteEnbPhy> ())
50
.AddAttribute (
"LteEnbMac"
,
51
"The MAC associated to this EnbNetDevice"
,
52
PointerValue
(),
53
MakePointerAccessor
(&
ComponentCarrierEnb::m_mac
),
54
MakePointerChecker <LteEnbMac> ())
55
.AddAttribute (
"FfMacScheduler"
,
56
"The scheduler associated to this EnbNetDevice"
,
57
PointerValue
(),
58
MakePointerAccessor
(&
ComponentCarrierEnb::m_scheduler
),
59
MakePointerChecker <FfMacScheduler> ())
60
.AddAttribute (
"LteFfrAlgorithm"
,
61
"The FFR algorithm associated to this EnbNetDevice"
,
62
PointerValue
(),
63
MakePointerAccessor
(&
ComponentCarrierEnb::m_ffrAlgorithm
),
64
MakePointerChecker <LteFfrAlgorithm> ())
65
;
66
return
tid;
67
}
68
ComponentCarrierEnb::ComponentCarrierEnb
()
69
{
70
NS_LOG_FUNCTION
(
this
);
71
}
72
73
ComponentCarrierEnb::~ComponentCarrierEnb
(
void
)
74
{
75
NS_LOG_FUNCTION
(
this
);
76
}
77
78
void
79
ComponentCarrierEnb::DoDispose
()
80
{
81
NS_LOG_FUNCTION
(
this
);
82
if
(
m_phy
)
83
{
84
m_phy
->Dispose ();
85
m_phy
= 0;
86
}
87
if
(
m_mac
)
88
{
89
m_mac
->Dispose ();
90
m_mac
= 0;
91
}
92
if
(
m_scheduler
)
93
{
94
m_scheduler
->Dispose ();
95
m_scheduler
= 0;
96
}
97
if
(
m_ffrAlgorithm
)
98
{
99
m_ffrAlgorithm
->Dispose ();
100
m_ffrAlgorithm
= 0;
101
}
102
103
Object::DoDispose
();
104
}
105
106
107
void
108
ComponentCarrierEnb::DoInitialize
(
void
)
109
{
110
NS_LOG_FUNCTION
(
this
);
111
m_phy
->Initialize ();
112
m_mac
->Initialize ();
113
m_ffrAlgorithm
->Initialize ();
114
m_scheduler
->Initialize();
115
116
}
117
118
Ptr<LteEnbPhy>
119
ComponentCarrierEnb::GetPhy
()
120
{
121
NS_LOG_FUNCTION
(
this
);
122
return
m_phy
;
123
}
124
125
126
void
127
ComponentCarrierEnb::SetPhy
(
Ptr<LteEnbPhy>
s)
128
{
129
NS_LOG_FUNCTION
(
this
);
130
m_phy
= s;
131
}
132
133
Ptr<LteEnbMac>
134
ComponentCarrierEnb::GetMac
()
135
{
136
NS_LOG_FUNCTION
(
this
);
137
return
m_mac
;
138
}
139
void
140
ComponentCarrierEnb::SetMac
(
Ptr<LteEnbMac>
s)
141
{
142
NS_LOG_FUNCTION
(
this
);
143
m_mac
= s;
144
}
145
146
Ptr<LteFfrAlgorithm>
147
ComponentCarrierEnb::GetFfrAlgorithm
()
148
{
149
NS_LOG_FUNCTION
(
this
);
150
return
m_ffrAlgorithm
;
151
}
152
153
void
154
ComponentCarrierEnb::SetFfrAlgorithm
(
Ptr<LteFfrAlgorithm>
s)
155
{
156
NS_LOG_FUNCTION
(
this
);
157
m_ffrAlgorithm
= s;
158
}
159
160
Ptr<FfMacScheduler>
161
ComponentCarrierEnb::GetFfMacScheduler
()
162
{
163
NS_LOG_FUNCTION
(
this
);
164
return
m_scheduler
;
165
}
166
167
void
168
ComponentCarrierEnb::SetFfMacScheduler
(
Ptr<FfMacScheduler>
s)
169
{
170
NS_LOG_FUNCTION
(
this
);
171
m_scheduler
= s;
172
}
173
174
}
// namespace ns3
175
176
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
ns3::ComponentCarrierEnb::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition:
component-carrier-enb.cc:79
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:45
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::ComponentCarrierEnb::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
component-carrier-enb.cc:38
ns3::ComponentCarrierEnb::GetFfMacScheduler
Ptr< FfMacScheduler > GetFfMacScheduler()
Definition:
component-carrier-enb.cc:161
ns3::PointerValue
Hold objects of type Ptr<T>.
Definition:
pointer.h:37
ns3::ComponentCarrierEnb::GetPhy
Ptr< LteEnbPhy > GetPhy(void)
Definition:
component-carrier-enb.cc:119
component-carrier-enb.h
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:923
ns3::ComponentCarrierEnb::GetFfrAlgorithm
Ptr< LteFfrAlgorithm > GetFfrAlgorithm()
Definition:
component-carrier-enb.cc:147
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:74
ns3::ComponentCarrierEnb::SetMac
void SetMac(Ptr< LteEnbMac > s)
Set the LteEnbMac.
Definition:
component-carrier-enb.cc:140
ns3::ComponentCarrierEnb::SetPhy
void SetPhy(Ptr< LteEnbPhy > s)
Set the LteEnbPhy.
Definition:
component-carrier-enb.cc:127
ns3::ComponentCarrierEnb::SetFfrAlgorithm
void SetFfrAlgorithm(Ptr< LteFfrAlgorithm > s)
Set the LteFfrAlgorithm.
Definition:
component-carrier-enb.cc:154
ns3::ComponentCarrier
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
Definition:
component-carrier.h:40
ns3::ComponentCarrierEnb::SetFfMacScheduler
void SetFfMacScheduler(Ptr< FfMacScheduler > s)
Set the FfMacScheduler Algorithm.
Definition:
component-carrier-enb.cc:168
ns3::ComponentCarrierEnb::m_ffrAlgorithm
Ptr< LteFfrAlgorithm > m_ffrAlgorithm
the FFR algorithm instance of this eNodeB component carrier
Definition:
component-carrier-enb.h:113
ns3::ComponentCarrierEnb::~ComponentCarrierEnb
virtual ~ComponentCarrierEnb(void)
Definition:
component-carrier-enb.cc:73
ns3::ComponentCarrierEnb::DoInitialize
virtual void DoInitialize(void)
Initialize() implementation.
Definition:
component-carrier-enb.cc:108
ns3::MakePointerAccessor
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition:
pointer.h:227
ns3::ComponentCarrierEnb::m_scheduler
Ptr< FfMacScheduler > m_scheduler
the scheduler instance of this eNodeB component carrier
Definition:
component-carrier-enb.h:112
ns3::ComponentCarrierEnb::ComponentCarrierEnb
ComponentCarrierEnb()
Definition:
component-carrier-enb.cc:68
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::ComponentCarrierEnb::m_phy
Ptr< LteEnbPhy > m_phy
the Phy instance of this eNodeB component carrier
Definition:
component-carrier-enb.h:110
ns3::ComponentCarrierEnb::m_mac
Ptr< LteEnbMac > m_mac
the MAC instance of this eNodeB component carrier
Definition:
component-carrier-enb.h:111
ns3::Object::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition:
object.cc:346
ns3::ComponentCarrierEnb::GetMac
Ptr< LteEnbMac > GetMac(void)
Definition:
component-carrier-enb.cc:134
src
lte
model
component-carrier-enb.cc
Generated on Fri Oct 1 2021 17:03:16 for ns-3 by
1.8.20