A Discrete-Event Network Simulator
API
component-carrier-ue.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-ue.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-ue-phy.h>
28 #include <ns3/lte-ue-mac.h>
29 #include <ns3/pointer.h>
30 
31 namespace ns3 {
32 
33 NS_LOG_COMPONENT_DEFINE ("ComponentCarrierUe");
34 
35 NS_OBJECT_ENSURE_REGISTERED ( ComponentCarrierUe);
36 
38 {
39  static TypeId
40  tid =
41  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  ;
55  return tid;
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 = 0;
73  m_mac->Dispose ();
74  m_mac = 0;
76 }
77 
78 
79 void
81 {
82  NS_LOG_FUNCTION (this);
83  m_isConstructed = true;
84  m_phy->Initialize ();
85  m_mac->Initialize();
86 }
87 
88 void
90 {
91  NS_LOG_FUNCTION (this);
92  m_phy = s;
93 }
94 
95 
98 {
99  NS_LOG_FUNCTION (this);
100  return m_phy;
101 }
102 
103 void
105 {
106  NS_LOG_FUNCTION (this);
107  m_mac = s;
108 }
109 
112 {
113  NS_LOG_FUNCTION (this);
114  return m_mac;
115 }
116 
117 } // namespace ns3
118 
119 
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 "...
virtual void DoDispose(void)
Destructor implementation.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
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...
void SetMac(Ptr< LteUeMac > s)
Set the LteEnbMac.
Ptr< LteUeMac > GetMac(void) const
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< LteUePhy > m_phy
the Phy instance of this eNodeB component carrier
Ptr< LteUePhy > GetPhy(void) const
static TypeId GetTypeId(void)
Get the type ID.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Hold objects of type Ptr<T>.
Definition: pointer.h:36
Ptr< LteUeMac > m_mac
the MAC instance of this eNodeB component carrier
virtual void DoInitialize(void)
Initialize() implementation.
void SetPhy(Ptr< LteUePhy > s)
Set LteUePhy.
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:915