A Discrete-Event Network Simulator
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 
39 {
40  static TypeId
41  tid =
42  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  ;
66  return tid;
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 = 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 
104 }
105 
106 
107 void
109 {
110  NS_LOG_FUNCTION (this);
111  m_isConstructed = true;
112  m_phy->Initialize ();
113  m_mac->Initialize ();
114  m_ffrAlgorithm->Initialize ();
115  m_scheduler->Initialize();
116 
117 }
118 
121 {
122  NS_LOG_FUNCTION (this);
123  return m_phy;
124 }
125 
126 
127 void
129 {
130  NS_LOG_FUNCTION (this);
131  m_phy = s;
132 }
133 
136 {
137  NS_LOG_FUNCTION (this);
138  return m_mac;
139 }
140 void
142 {
143  NS_LOG_FUNCTION (this);
144  m_mac = s;
145 }
146 
149 {
150  NS_LOG_FUNCTION (this);
151  return m_ffrAlgorithm;
152 }
153 
154 void
156 {
157  NS_LOG_FUNCTION (this);
158  m_ffrAlgorithm = s;
159 }
160 
163 {
164  NS_LOG_FUNCTION (this);
165  return m_scheduler;
166 }
167 
168 void
170 {
171  NS_LOG_FUNCTION (this);
172  m_scheduler = s;
173 }
174 
176 {
177  static TypeId
178  tid =
179  TypeId ("ns3::ComponentCarrierBaseStation")
181  .AddConstructor<ComponentCarrierBaseStation> ()
182  ;
183  return tid;
184 }
185 
187 {
188  NS_LOG_FUNCTION (this);
189 }
190 
192 {
193  NS_LOG_FUNCTION (this);
194 }
195 
196 uint16_t
198 {
199  return m_cellId;
200 }
201 
202 void
204 {
205  NS_LOG_FUNCTION (this << cellId);
206  m_cellId = cellId;
207 }
208 
209 } // namespace ns3
210 
211 
static TypeId GetTypeId(void)
Get the type ID.
void SetFfrAlgorithm(Ptr< LteFfrAlgorithm > s)
Set the LteFfrAlgorithm.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
#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
uint16_t m_cellId
Cell identifier.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:204
virtual void DoDispose(void)
Destructor implementation.
Definition: object.cc:346
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
Ptr< LteEnbMac > m_mac
the MAC instance of this eNodeB component carrier
void SetPhy(Ptr< LteEnbPhy > s)
Set the LteEnbPhy.
static TypeId GetTypeId(void)
Get the type ID.
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:220
bool m_isConstructed
whether the instance is constructed
Ptr< FfMacScheduler > GetFfMacScheduler()
Ptr< LteEnbMac > GetMac(void)
virtual void DoInitialize(void)
Initialize() implementation.
virtual void DoDispose(void)
Destructor implementation.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Hold objects of type Ptr<T>.
Definition: pointer.h:36
void SetCellId(uint16_t cellId)
Set physical cell identifier.
void SetFfMacScheduler(Ptr< FfMacScheduler > s)
Set the FfMacScheduler Algorithm.
void SetMac(Ptr< LteEnbMac > s)
Set the LteEnbMac.
Ptr< FfMacScheduler > m_scheduler
the scheduler instance of this eNodeB component carrier
uint16_t GetCellId()
Get cell identifier.
Ptr< LteFfrAlgorithm > m_ffrAlgorithm
the FFR algorithm instance of this eNodeB component carrier
Ptr< LteFfrAlgorithm > GetFfrAlgorithm()
Ptr< LteEnbPhy > GetPhy(void)
Ptr< LteEnbPhy > m_phy
the Phy instance of this eNodeB component carrier
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:915