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
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
33namespace ns3 {
34
35NS_LOG_COMPONENT_DEFINE ("ComponentCarrierEnb");
36NS_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
78void
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 }
98 {
99 m_ffrAlgorithm->Dispose ();
100 m_ffrAlgorithm = 0;
101 }
102
104}
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}
117
120{
121 NS_LOG_FUNCTION (this);
122 return m_phy;
123}
124
125
126void
128{
129 NS_LOG_FUNCTION (this);
130 m_phy = s;
131}
132
135{
136 NS_LOG_FUNCTION (this);
137 return m_mac;
138}
139void
141{
142 NS_LOG_FUNCTION (this);
143 m_mac = s;
144}
145
148{
149 NS_LOG_FUNCTION (this);
150 return m_ffrAlgorithm;
151}
152
153void
155{
156 NS_LOG_FUNCTION (this);
157 m_ffrAlgorithm = s;
158}
159
162{
163 NS_LOG_FUNCTION (this);
164 return m_scheduler;
165}
166
167void
169{
170 NS_LOG_FUNCTION (this);
171 m_scheduler = s;
172}
173
174} // namespace ns3
175
176
Ptr< LteFfrAlgorithm > GetFfrAlgorithm()
Ptr< FfMacScheduler > m_scheduler
the scheduler instance of this eNodeB component carrier
Ptr< LteEnbMac > m_mac
the MAC instance of this eNodeB component carrier
virtual void DoInitialize(void)
Initialize() implementation.
Ptr< LteEnbMac > GetMac(void)
void SetFfrAlgorithm(Ptr< LteFfrAlgorithm > s)
Set the LteFfrAlgorithm.
Ptr< LteFfrAlgorithm > m_ffrAlgorithm
the FFR algorithm instance of this eNodeB component carrier
virtual void DoDispose(void)
Destructor implementation.
static TypeId GetTypeId(void)
Get the type ID.
Ptr< LteEnbPhy > GetPhy(void)
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(void)
Destructor implementation.
Definition: object.cc:346
Hold objects of type Ptr<T>.
Definition: pointer.h:37
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:922
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Definition: pointer.h:227
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
#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
Every class exported by the ns3 library is enclosed in the ns3 namespace.