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_phy->Initialize ();
84  m_mac->Initialize();
85 }
86 
87 void
89 {
90  NS_LOG_FUNCTION (this);
91  m_phy = s;
92 }
93 
94 
97 {
98  NS_LOG_FUNCTION (this);
99  return m_phy;
100 }
101 
102 void
104 {
105  NS_LOG_FUNCTION (this);
106  m_mac = s;
107 }
108 
111 {
112  NS_LOG_FUNCTION (this);
113  return m_mac;
114 }
115 
116 } // namespace ns3
117 
118 
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
static TypeId GetTypeId(void)
Get the type ID.
Ptr< LteUePhy > m_phy
the Phy instance of this eNodeB component carrier
Ptr< LteUePhy > GetPhy(void) const
Ptr< LteUeMac > GetMac(void) const
Ptr< LteUeMac > m_mac
the MAC instance of this eNodeB component carrier
void SetPhy(Ptr< LteUePhy > s)
Set LteUePhy.
virtual void DoDispose(void)
Destructor implementation.
virtual void DoInitialize(void)
Initialize() implementation.
void SetMac(Ptr< LteUeMac > s)
Set the LteEnbMac.
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)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
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.