A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
lte-phy-tag.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
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: Marco Miozzo <marco.miozzo@cttc.es>
18
* Nicola Baldo <nbaldo@cttc.es>
19
*/
20
21
#include "
lte-phy-tag.h
"
22
23
#include "ns3/tag.h"
24
#include "ns3/uinteger.h"
25
26
namespace
ns3
27
{
28
29
NS_OBJECT_ENSURE_REGISTERED
(LtePhyTag);
30
31
TypeId
32
LtePhyTag::GetTypeId
()
33
{
34
static
TypeId
tid =
35
TypeId
(
"ns3::LtePhyTag"
).
SetParent
<
Tag
>().SetGroupName(
"Lte"
).AddConstructor<
LtePhyTag
>();
36
return
tid;
37
}
38
39
TypeId
40
LtePhyTag::GetInstanceTypeId
()
const
41
{
42
return
GetTypeId
();
43
}
44
45
LtePhyTag::LtePhyTag
()
46
{
47
}
48
49
LtePhyTag::LtePhyTag
(uint16_t cellId)
50
: m_cellId(cellId)
51
{
52
}
53
54
LtePhyTag::~LtePhyTag
()
55
{
56
}
57
58
uint32_t
59
LtePhyTag::GetSerializedSize
()
const
60
{
61
return
2;
62
}
63
64
void
65
LtePhyTag::Serialize
(
TagBuffer
i)
const
66
{
67
i.
WriteU16
(
m_cellId
);
68
}
69
70
void
71
LtePhyTag::Deserialize
(
TagBuffer
i)
72
{
73
m_cellId
= i.
ReadU16
();
74
}
75
76
void
77
LtePhyTag::Print
(std::ostream& os)
const
78
{
79
os <<
m_cellId
;
80
}
81
82
uint16_t
83
LtePhyTag::GetCellId
()
const
84
{
85
return
m_cellId
;
86
}
87
88
}
// namespace ns3
ns3::LtePhyTag
Tag used to define PHY parameters.
Definition:
lte-phy-tag.h:32
ns3::LtePhyTag::Print
void Print(std::ostream &os) const override
Definition:
lte-phy-tag.cc:77
ns3::LtePhyTag::~LtePhyTag
~LtePhyTag() override
Definition:
lte-phy-tag.cc:54
ns3::LtePhyTag::m_cellId
uint16_t m_cellId
the cell ID
Definition:
lte-phy-tag.h:67
ns3::LtePhyTag::Deserialize
void Deserialize(TagBuffer i) override
Definition:
lte-phy-tag.cc:71
ns3::LtePhyTag::LtePhyTag
LtePhyTag()
Create an empty LtePhyTag.
Definition:
lte-phy-tag.cc:45
ns3::LtePhyTag::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition:
lte-phy-tag.cc:59
ns3::LtePhyTag::GetCellId
uint16_t GetCellId() const
Get cell ID.
Definition:
lte-phy-tag.cc:83
ns3::LtePhyTag::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
lte-phy-tag.cc:32
ns3::LtePhyTag::Serialize
void Serialize(TagBuffer i) const override
Definition:
lte-phy-tag.cc:65
ns3::LtePhyTag::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition:
lte-phy-tag.cc:40
ns3::TagBuffer
read and write tag data
Definition:
tag-buffer.h:52
ns3::TagBuffer::ReadU16
TAG_BUFFER_INLINE uint16_t ReadU16()
Definition:
tag-buffer.h:206
ns3::TagBuffer::WriteU16
TAG_BUFFER_INLINE void WriteU16(uint16_t v)
Definition:
tag-buffer.h:180
ns3::Tag
tag a set of bytes in a packet
Definition:
tag.h:39
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:931
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:46
lte-phy-tag.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lte
model
lte-phy-tag.cc
Generated on Sun Mar 3 2024 17:11:02 for ns-3 by
1.9.1