A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
lte-pdcp-tag.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 CTTC
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Jaume Nin <jaume.nin@cttc.es>
7
* Nicola Baldo <nbaldo@cttc.es>
8
*/
9
10
#include "
lte-pdcp-tag.h
"
11
12
#include "ns3/tag.h"
13
#include "ns3/uinteger.h"
14
15
namespace
ns3
16
{
17
18
NS_OBJECT_ENSURE_REGISTERED
(PdcpTag);
19
20
PdcpTag::PdcpTag
()
21
: m_senderTimestamp(
Seconds
(0))
22
{
23
// Nothing to do here
24
}
25
26
PdcpTag::PdcpTag
(
Time
senderTimestamp)
27
: m_senderTimestamp(senderTimestamp)
28
29
{
30
// Nothing to do here
31
}
32
33
TypeId
34
PdcpTag::GetTypeId
()
35
{
36
static
TypeId
tid =
37
TypeId
(
"ns3::PdcpTag"
).
SetParent
<
Tag
>().SetGroupName(
"Lte"
).AddConstructor<
PdcpTag
>();
38
return
tid;
39
}
40
41
TypeId
42
PdcpTag::GetInstanceTypeId
()
const
43
{
44
return
GetTypeId
();
45
}
46
47
uint32_t
48
PdcpTag::GetSerializedSize
()
const
49
{
50
return
sizeof
(
Time
);
51
}
52
53
void
54
PdcpTag::Serialize
(
TagBuffer
i)
const
55
{
56
int64_t senderTimestamp =
m_senderTimestamp
.
GetNanoSeconds
();
57
i.
Write
((
const
uint8_t*)&senderTimestamp,
sizeof
(int64_t));
58
}
59
60
void
61
PdcpTag::Deserialize
(
TagBuffer
i)
62
{
63
int64_t senderTimestamp;
64
i.
Read
((uint8_t*)&senderTimestamp, 8);
65
m_senderTimestamp
=
NanoSeconds
(senderTimestamp);
66
}
67
68
void
69
PdcpTag::Print
(std::ostream& os)
const
70
{
71
os <<
m_senderTimestamp
;
72
}
73
74
Time
75
PdcpTag::GetSenderTimestamp
()
const
76
{
77
return
m_senderTimestamp
;
78
}
79
80
void
81
PdcpTag::SetSenderTimestamp
(
Time
senderTimestamp)
82
{
83
this->
m_senderTimestamp
= senderTimestamp;
84
}
85
86
}
// namespace ns3
ns3::PdcpTag
Tag to calculate the per-PDU delay from eNb PDCP to UE PDCP.
Definition
lte-pdcp-tag.h:26
ns3::PdcpTag::SetSenderTimestamp
void SetSenderTimestamp(Time senderTimestamp)
Set the sender timestamp.
Definition
lte-pdcp-tag.cc:81
ns3::PdcpTag::Serialize
void Serialize(TagBuffer i) const override
Definition
lte-pdcp-tag.cc:54
ns3::PdcpTag::GetSenderTimestamp
Time GetSenderTimestamp() const
Get the instant when the PDCP delivers the PDU to the MAC SAP provider.
Definition
lte-pdcp-tag.cc:75
ns3::PdcpTag::m_senderTimestamp
Time m_senderTimestamp
sender timestamp
Definition
lte-pdcp-tag.h:64
ns3::PdcpTag::Print
void Print(std::ostream &os) const override
Definition
lte-pdcp-tag.cc:69
ns3::PdcpTag::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
lte-pdcp-tag.cc:42
ns3::PdcpTag::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
lte-pdcp-tag.cc:34
ns3::PdcpTag::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
lte-pdcp-tag.cc:48
ns3::PdcpTag::Deserialize
void Deserialize(TagBuffer i) override
Definition
lte-pdcp-tag.cc:61
ns3::PdcpTag::PdcpTag
PdcpTag()
Create an empty PDCP tag.
Definition
lte-pdcp-tag.cc:20
ns3::TagBuffer
read and write tag data
Definition
tag-buffer.h:41
ns3::TagBuffer::Read
void Read(uint8_t *buffer, uint32_t size)
Definition
tag-buffer.cc:172
ns3::TagBuffer::Write
void Write(const uint8_t *buffer, uint32_t size)
Definition
tag-buffer.cc:118
ns3::Tag
tag a set of bytes in a packet
Definition
tag.h:28
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::Time::GetNanoSeconds
int64_t GetNanoSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition
nstime.h:407
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
uint32_t
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition
object-base.h:35
ns3::NanoSeconds
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition
nstime.h:1344
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition
nstime.h:1308
lte-pdcp-tag.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lte
model
lte-pdcp-tag.cc
Generated on Fri Nov 8 2024 13:59:03 for ns-3 by
1.11.0