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-rlc-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
*/
8
9
#include "
lte-rlc-tag.h
"
10
11
#include "ns3/tag.h"
12
#include "ns3/uinteger.h"
13
14
namespace
ns3
15
{
16
17
NS_OBJECT_ENSURE_REGISTERED
(RlcTag);
18
19
RlcTag::RlcTag
()
20
: m_senderTimestamp(
Seconds
(0))
21
{
22
// Nothing to do here
23
}
24
25
RlcTag::RlcTag
(
Time
senderTimestamp)
26
: m_senderTimestamp(senderTimestamp)
27
28
{
29
// Nothing to do here
30
}
31
32
TypeId
33
RlcTag::GetTypeId
()
34
{
35
static
TypeId
tid =
36
TypeId
(
"ns3::RlcTag"
).
SetParent
<
Tag
>().SetGroupName(
"Lte"
).AddConstructor<
RlcTag
>();
37
return
tid;
38
}
39
40
TypeId
41
RlcTag::GetInstanceTypeId
()
const
42
{
43
return
GetTypeId
();
44
}
45
46
uint32_t
47
RlcTag::GetSerializedSize
()
const
48
{
49
return
sizeof
(
Time
);
50
}
51
52
void
53
RlcTag::Serialize
(
TagBuffer
i)
const
54
{
55
int64_t senderTimestamp =
m_senderTimestamp
.
GetNanoSeconds
();
56
i.
Write
((
const
uint8_t*)&senderTimestamp,
sizeof
(int64_t));
57
}
58
59
void
60
RlcTag::Deserialize
(
TagBuffer
i)
61
{
62
int64_t senderTimestamp;
63
i.
Read
((uint8_t*)&senderTimestamp, 8);
64
m_senderTimestamp
=
NanoSeconds
(senderTimestamp);
65
}
66
67
void
68
RlcTag::Print
(std::ostream& os)
const
69
{
70
os <<
m_senderTimestamp
;
71
}
72
73
}
// namespace ns3
ns3::RlcTag
Tag to calculate the per-PDU delay from eNb RLC to UE RLC.
Definition
lte-rlc-tag.h:25
ns3::RlcTag::m_senderTimestamp
Time m_senderTimestamp
sender timestamp
Definition
lte-rlc-tag.h:69
ns3::RlcTag::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
lte-rlc-tag.cc:47
ns3::RlcTag::RlcTag
RlcTag()
Create an empty RLC tag.
Definition
lte-rlc-tag.cc:19
ns3::RlcTag::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
lte-rlc-tag.cc:33
ns3::RlcTag::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
lte-rlc-tag.cc:41
ns3::RlcTag::Serialize
void Serialize(TagBuffer i) const override
Definition
lte-rlc-tag.cc:53
ns3::RlcTag::Print
void Print(std::ostream &os) const override
Definition
lte-rlc-tag.cc:68
ns3::RlcTag::Deserialize
void Deserialize(TagBuffer i) override
Definition
lte-rlc-tag.cc:60
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-rlc-tag.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lte
model
lte-rlc-tag.cc
Generated on Thu Oct 3 2024 18:32:37 for ns-3 by
1.11.0