A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
component-carrier-enb.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 Danilo Abrignani
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Danilo Abrignani <danilo.abrignani@unibo.it>
18 */
19
21
22#include "ff-mac-scheduler.h"
23#include "lte-enb-mac.h"
24#include "lte-enb-phy.h"
25#include "lte-ffr-algorithm.h"
26
27#include <ns3/abort.h>
28#include <ns3/boolean.h>
29#include <ns3/log.h>
30#include <ns3/pointer.h>
31#include <ns3/simulator.h>
32#include <ns3/uinteger.h>
33
34namespace ns3
35{
36
37NS_LOG_COMPONENT_DEFINE("ComponentCarrierEnb");
38NS_OBJECT_ENSURE_REGISTERED(ComponentCarrierEnb);
39
40TypeId
42{
43 static TypeId tid = TypeId("ns3::ComponentCarrierEnb")
45 .AddConstructor<ComponentCarrierEnb>()
46 .AddAttribute("LteEnbPhy",
47 "The PHY associated to this EnbNetDevice",
50 MakePointerChecker<LteEnbPhy>())
51 .AddAttribute("LteEnbMac",
52 "The MAC associated to this EnbNetDevice",
55 MakePointerChecker<LteEnbMac>())
56 .AddAttribute("FfMacScheduler",
57 "The scheduler associated to this EnbNetDevice",
60 MakePointerChecker<FfMacScheduler>())
61 .AddAttribute("LteFfrAlgorithm",
62 "The FFR algorithm associated to this EnbNetDevice",
65 MakePointerChecker<LteFfrAlgorithm>());
66 return tid;
67}
68
70{
71 NS_LOG_FUNCTION(this);
72}
73
75{
76 NS_LOG_FUNCTION(this);
77}
78
79void
81{
82 NS_LOG_FUNCTION(this);
83 if (m_phy)
84 {
85 m_phy->Dispose();
86 m_phy = nullptr;
87 }
88 if (m_mac)
89 {
90 m_mac->Dispose();
91 m_mac = nullptr;
92 }
93 if (m_scheduler)
94 {
95 m_scheduler->Dispose();
96 m_scheduler = nullptr;
97 }
99 {
100 m_ffrAlgorithm->Dispose();
101 m_ffrAlgorithm = nullptr;
102 }
103
105}
106
107void
109{
110 NS_LOG_FUNCTION(this);
111 m_phy->Initialize();
112 m_mac->Initialize();
113 m_ffrAlgorithm->Initialize();
114 m_scheduler->Initialize();
115}
116
119{
120 NS_LOG_FUNCTION(this);
121 return m_phy;
122}
123
124void
126{
127 NS_LOG_FUNCTION(this);
128 m_phy = s;
129}
130
133{
134 NS_LOG_FUNCTION(this);
135 return m_mac;
136}
137
138void
140{
141 NS_LOG_FUNCTION(this);
142 m_mac = s;
143}
144
147{
148 NS_LOG_FUNCTION(this);
149 return m_ffrAlgorithm;
150}
151
152void
154{
155 NS_LOG_FUNCTION(this);
156 m_ffrAlgorithm = s;
157}
158
161{
162 NS_LOG_FUNCTION(this);
163 return m_scheduler;
164}
165
166void
168{
169 NS_LOG_FUNCTION(this);
170 m_scheduler = s;
171}
172
173} // namespace ns3
void DoInitialize() override
Initialize() implementation.
void DoDispose() override
Destructor implementation.
Ptr< LteFfrAlgorithm > GetFfrAlgorithm()
static TypeId GetTypeId()
Get the type ID.
Ptr< FfMacScheduler > m_scheduler
the scheduler instance of this eNodeB component carrier
Ptr< LteEnbMac > m_mac
the MAC instance of this eNodeB component carrier
void SetFfrAlgorithm(Ptr< LteFfrAlgorithm > s)
Set the LteFfrAlgorithm.
Ptr< LteFfrAlgorithm > m_ffrAlgorithm
the FFR algorithm instance of this eNodeB component carrier
void SetMac(Ptr< LteEnbMac > s)
Set the LteEnbMac.
void SetFfMacScheduler(Ptr< FfMacScheduler > s)
Set the FfMacScheduler Algorithm.
Ptr< FfMacScheduler > GetFfMacScheduler()
Ptr< LteEnbPhy > m_phy
the Phy instance of this eNodeB component carrier
void SetPhy(Ptr< LteEnbPhy > s)
Set the LteEnbPhy.
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
virtual void DoDispose()
Destructor implementation.
Definition: object.cc:444
AttributeValue implementation for Pointer.
Definition: pointer.h:48
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:932
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Definition: pointer.h:259
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#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:46
Every class exported by the ns3 library is enclosed in the ns3 namespace.