A Discrete-Event Network Simulator
API
component-carrier-ue.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-ue.h"
21 
22 #include <ns3/abort.h>
23 #include <ns3/boolean.h>
24 #include <ns3/log.h>
25 #include <ns3/lte-ue-mac.h>
26 #include <ns3/lte-ue-phy.h>
27 #include <ns3/pointer.h>
28 #include <ns3/simulator.h>
29 #include <ns3/uinteger.h>
30 
31 namespace ns3
32 {
33 
34 NS_LOG_COMPONENT_DEFINE("ComponentCarrierUe");
35 
36 NS_OBJECT_ENSURE_REGISTERED(ComponentCarrierUe);
37 
38 TypeId
40 {
41  static TypeId tid = TypeId("ns3::ComponentCarrierUe")
43  .AddConstructor<ComponentCarrierUe>()
44  .AddAttribute("LteUePhy",
45  "The PHY associated to this EnbNetDevice",
46  PointerValue(),
48  MakePointerChecker<LteUePhy>())
49  .AddAttribute("LteUeMac",
50  "The MAC associated to this UeNetDevice",
51  PointerValue(),
53  MakePointerChecker<LteUeMac>());
54  return tid;
55 }
56 
58 {
59  NS_LOG_FUNCTION(this);
60 }
61 
63 {
64  NS_LOG_FUNCTION(this);
65 }
66 
67 void
69 {
70  NS_LOG_FUNCTION(this);
71  m_phy->Dispose();
72  m_phy = nullptr;
73  m_mac->Dispose();
74  m_mac = nullptr;
76 }
77 
78 void
80 {
81  NS_LOG_FUNCTION(this);
82  m_phy->Initialize();
83  m_mac->Initialize();
84 }
85 
86 void
88 {
89  NS_LOG_FUNCTION(this);
90  m_phy = s;
91 }
92 
95 {
96  NS_LOG_FUNCTION(this);
97  return m_phy;
98 }
99 
100 void
102 {
103  NS_LOG_FUNCTION(this);
104  m_mac = s;
105 }
106 
109 {
110  NS_LOG_FUNCTION(this);
111  return m_mac;
112 }
113 
114 } // namespace ns3
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
void DoInitialize() override
Initialize() implementation.
void DoDispose() override
Destructor implementation.
Ptr< LteUePhy > m_phy
the Phy instance of this eNodeB component carrier
static TypeId GetTypeId()
Get the type ID.
Ptr< LteUeMac > GetMac() const
Ptr< LteUeMac > m_mac
the MAC instance of this eNodeB component carrier
void SetPhy(Ptr< LteUePhy > s)
Set LteUePhy.
void SetMac(Ptr< LteUeMac > s)
Set the LteEnbMac.
Ptr< LteUePhy > GetPhy() const
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.