A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
lte
model
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
37
TypeId
ComponentCarrierUe::GetTypeId
(
void
)
38
{
39
static
TypeId
40
tid =
41
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
;
55
return
tid;
56
}
57
ComponentCarrierUe::ComponentCarrierUe
()
58
{
59
NS_LOG_FUNCTION
(
this
);
60
}
61
62
ComponentCarrierUe::~ComponentCarrierUe
(
void
)
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
= 0;
73
m_mac
->Dispose ();
74
m_mac
= 0;
75
Object::DoDispose
();
76
}
77
78
79
void
80
ComponentCarrierUe::DoInitialize
(
void
)
81
{
82
NS_LOG_FUNCTION
(
this
);
83
m_isConstructed
=
true
;
84
m_phy
->Initialize ();
85
m_mac
->Initialize();
86
}
87
88
void
89
ComponentCarrierUe::SetPhy
(
Ptr<LteUePhy>
s)
90
{
91
NS_LOG_FUNCTION
(
this
);
92
m_phy
= s;
93
}
94
95
96
Ptr<LteUePhy>
97
ComponentCarrierUe::GetPhy
()
const
98
{
99
NS_LOG_FUNCTION
(
this
);
100
return
m_phy
;
101
}
102
103
void
104
ComponentCarrierUe::SetMac
(
Ptr<LteUeMac>
s)
105
{
106
NS_LOG_FUNCTION
(
this
);
107
m_mac
= s;
108
}
109
110
Ptr<LteUeMac>
111
ComponentCarrierUe::GetMac
()
const
112
{
113
NS_LOG_FUNCTION
(
this
);
114
return
m_mac
;
115
}
116
117
}
// namespace ns3
118
119
ns3::ComponentCarrierUe::~ComponentCarrierUe
virtual ~ComponentCarrierUe(void)
Definition:
component-carrier-ue.cc:62
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
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:213
ns3::ComponentCarrierUe::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition:
component-carrier-ue.cc:68
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:45
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition:
log.h:202
ns3::Object::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition:
object.cc:346
ns3::ComponentCarrier
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
Definition:
component-carrier.h:45
ns3::ComponentCarrierUe::SetMac
void SetMac(Ptr< LteUeMac > s)
Set the LteEnbMac.
Definition:
component-carrier-ue.cc:104
ns3::ComponentCarrierUe::GetMac
Ptr< LteUeMac > GetMac(void) const
Definition:
component-carrier-ue.cc:111
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:220
ns3::ComponentCarrier::m_isConstructed
bool m_isConstructed
whether the instance is constructed
Definition:
component-carrier.h:170
ns3::ComponentCarrierUe::m_phy
Ptr< LteUePhy > m_phy
the Phy instance of this eNodeB component carrier
Definition:
component-carrier-ue.h:83
ns3::ComponentCarrierUe::ComponentCarrierUe
ComponentCarrierUe()
Definition:
component-carrier-ue.cc:57
ns3::ComponentCarrierUe::GetPhy
Ptr< LteUePhy > GetPhy(void) const
Definition:
component-carrier-ue.cc:97
ns3::ComponentCarrierUe::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
component-carrier-ue.cc:37
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::PointerValue
Hold objects of type Ptr<T>.
Definition:
pointer.h:36
ns3::ComponentCarrierUe::m_mac
Ptr< LteUeMac > m_mac
the MAC instance of this eNodeB component carrier
Definition:
component-carrier-ue.h:84
ns3::ComponentCarrierUe::DoInitialize
virtual void DoInitialize(void)
Initialize() implementation.
Definition:
component-carrier-ue.cc:80
ns3::ComponentCarrierUe::SetPhy
void SetPhy(Ptr< LteUePhy > s)
Set LteUePhy.
Definition:
component-carrier-ue.cc:89
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:915
Generated on Wed Nov 7 2018 10:01:59 for ns-3 by
1.8.14