A Discrete-Event Network Simulator
API
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 
20 #include "component-carrier-enb.h"
21 
22 #include <ns3/abort.h>
23 #include <ns3/boolean.h>
24 #include <ns3/ff-mac-scheduler.h>
25 #include <ns3/log.h>
26 #include <ns3/lte-enb-mac.h>
27 #include <ns3/lte-enb-phy.h>
28 #include <ns3/lte-ffr-algorithm.h>
29 #include <ns3/pointer.h>
30 #include <ns3/simulator.h>
31 #include <ns3/uinteger.h>
32 
33 namespace ns3
34 {
35 
36 NS_LOG_COMPONENT_DEFINE("ComponentCarrierEnb");
37 NS_OBJECT_ENSURE_REGISTERED(ComponentCarrierEnb);
38 
39 TypeId
41 {
42  static TypeId tid = TypeId("ns3::ComponentCarrierEnb")
44  .AddConstructor<ComponentCarrierEnb>()
45  .AddAttribute("LteEnbPhy",
46  "The PHY associated to this EnbNetDevice",
47  PointerValue(),
49  MakePointerChecker<LteEnbPhy>())
50  .AddAttribute("LteEnbMac",
51  "The MAC associated to this EnbNetDevice",
52  PointerValue(),
54  MakePointerChecker<LteEnbMac>())
55  .AddAttribute("FfMacScheduler",
56  "The scheduler associated to this EnbNetDevice",
57  PointerValue(),
59  MakePointerChecker<FfMacScheduler>())
60  .AddAttribute("LteFfrAlgorithm",
61  "The FFR algorithm associated to this EnbNetDevice",
62  PointerValue(),
64  MakePointerChecker<LteFfrAlgorithm>());
65  return tid;
66 }
67 
69 {
70  NS_LOG_FUNCTION(this);
71 }
72 
74 {
75  NS_LOG_FUNCTION(this);
76 }
77 
78 void
80 {
81  NS_LOG_FUNCTION(this);
82  if (m_phy)
83  {
84  m_phy->Dispose();
85  m_phy = nullptr;
86  }
87  if (m_mac)
88  {
89  m_mac->Dispose();
90  m_mac = nullptr;
91  }
92  if (m_scheduler)
93  {
94  m_scheduler->Dispose();
95  m_scheduler = nullptr;
96  }
97  if (m_ffrAlgorithm)
98  {
99  m_ffrAlgorithm->Dispose();
100  m_ffrAlgorithm = nullptr;
101  }
102 
104 }
105 
106 void
108 {
109  NS_LOG_FUNCTION(this);
110  m_phy->Initialize();
111  m_mac->Initialize();
112  m_ffrAlgorithm->Initialize();
113  m_scheduler->Initialize();
114 }
115 
118 {
119  NS_LOG_FUNCTION(this);
120  return m_phy;
121 }
122 
123 void
125 {
126  NS_LOG_FUNCTION(this);
127  m_phy = s;
128 }
129 
132 {
133  NS_LOG_FUNCTION(this);
134  return m_mac;
135 }
136 
137 void
139 {
140  NS_LOG_FUNCTION(this);
141  m_mac = s;
142 }
143 
146 {
147  NS_LOG_FUNCTION(this);
148  return m_ffrAlgorithm;
149 }
150 
151 void
153 {
154  NS_LOG_FUNCTION(this);
155  m_ffrAlgorithm = s;
156 }
157 
160 {
161  NS_LOG_FUNCTION(this);
162  return m_scheduler;
163 }
164 
165 void
167 {
168  NS_LOG_FUNCTION(this);
169  m_scheduler = s;
170 }
171 
172 } // 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:353
Hold objects of type Ptr<T>.
Definition: pointer.h:37
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
a unique identifier for an interface.
Definition: type-id.h:60
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:935
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:231
#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.