A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
39
ComponentCarrierUe::GetTypeId
()
40
{
41
static
TypeId
tid =
TypeId
(
"ns3::ComponentCarrierUe"
)
42
.
SetParent
<
ComponentCarrier
>()
43
.AddConstructor<ComponentCarrierUe>()
44
.AddAttribute(
"LteUePhy"
,
45
"The PHY associated to this EnbNetDevice"
,
46
PointerValue
(),
47
MakePointerAccessor
(&
ComponentCarrierUe::m_phy
),
48
MakePointerChecker<LteUePhy>())
49
.AddAttribute(
"LteUeMac"
,
50
"The MAC associated to this UeNetDevice"
,
51
PointerValue
(),
52
MakePointerAccessor
(&
ComponentCarrierUe::m_mac
),
53
MakePointerChecker<LteUeMac>());
54
return
tid;
55
}
56
57
ComponentCarrierUe::ComponentCarrierUe
()
58
{
59
NS_LOG_FUNCTION
(
this
);
60
}
61
62
ComponentCarrierUe::~ComponentCarrierUe
()
63
{
64
NS_LOG_FUNCTION
(
this
);
65
}
66
67
void
68
ComponentCarrierUe::DoDispose
()
69
{
70
NS_LOG_FUNCTION
(
this
);
71
m_phy
->Dispose();
72
m_phy
=
nullptr
;
73
m_mac
->Dispose();
74
m_mac
=
nullptr
;
75
Object::DoDispose
();
76
}
77
78
void
79
ComponentCarrierUe::DoInitialize
()
80
{
81
NS_LOG_FUNCTION
(
this
);
82
m_phy
->Initialize();
83
m_mac
->Initialize();
84
}
85
86
void
87
ComponentCarrierUe::SetPhy
(
Ptr<LteUePhy>
s)
88
{
89
NS_LOG_FUNCTION
(
this
);
90
m_phy
= s;
91
}
92
93
Ptr<LteUePhy>
94
ComponentCarrierUe::GetPhy
()
const
95
{
96
NS_LOG_FUNCTION
(
this
);
97
return
m_phy
;
98
}
99
100
void
101
ComponentCarrierUe::SetMac
(
Ptr<LteUeMac>
s)
102
{
103
NS_LOG_FUNCTION
(
this
);
104
m_mac
= s;
105
}
106
107
Ptr<LteUeMac>
108
ComponentCarrierUe::GetMac
()
const
109
{
110
NS_LOG_FUNCTION
(
this
);
111
return
m_mac
;
112
}
113
114
}
// namespace ns3
ns3::ComponentCarrier
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
Definition:
component-carrier.h:39
ns3::ComponentCarrierUe::ComponentCarrierUe
ComponentCarrierUe()
Definition:
component-carrier-ue.cc:57
ns3::ComponentCarrierUe::DoInitialize
void DoInitialize() override
Initialize() implementation.
Definition:
component-carrier-ue.cc:79
ns3::ComponentCarrierUe::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
component-carrier-ue.cc:68
ns3::ComponentCarrierUe::m_phy
Ptr< LteUePhy > m_phy
the Phy instance of this eNodeB component carrier
Definition:
component-carrier-ue.h:81
ns3::ComponentCarrierUe::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
component-carrier-ue.cc:39
ns3::ComponentCarrierUe::GetMac
Ptr< LteUeMac > GetMac() const
Definition:
component-carrier-ue.cc:108
ns3::ComponentCarrierUe::~ComponentCarrierUe
~ComponentCarrierUe() override
Definition:
component-carrier-ue.cc:62
ns3::ComponentCarrierUe::m_mac
Ptr< LteUeMac > m_mac
the MAC instance of this eNodeB component carrier
Definition:
component-carrier-ue.h:82
ns3::ComponentCarrierUe::SetPhy
void SetPhy(Ptr< LteUePhy > s)
Set LteUePhy.
Definition:
component-carrier-ue.cc:87
ns3::ComponentCarrierUe::SetMac
void SetMac(Ptr< LteUeMac > s)
Set the LteEnbMac.
Definition:
component-carrier-ue.cc:101
ns3::ComponentCarrierUe::GetPhy
Ptr< LteUePhy > GetPhy() const
Definition:
component-carrier-ue.cc:94
ns3::Object::DoDispose
virtual void DoDispose()
Destructor implementation.
Definition:
object.cc:353
ns3::PointerValue
Hold objects of type Ptr<T>.
Definition:
pointer.h:37
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:78
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:60
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:935
component-carrier-ue.h
ns3::MakePointerAccessor
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
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition:
log.h:202
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition:
log-macros-enabled.h:238
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:46
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lte
model
component-carrier-ue.cc
Generated on Fri Mar 31 2023 13:30:44 for ns-3 by
1.9.1