A Discrete-Event Network Simulator
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
14namespace ns3
15{
16
18
20 : m_senderTimestamp(Seconds(0))
21{
22 // Nothing to do here
23}
24
25RlcTag::RlcTag(Time senderTimestamp)
26 : m_senderTimestamp(senderTimestamp)
27
28{
29 // Nothing to do here
30}
31
34{
35 static TypeId tid =
36 TypeId("ns3::RlcTag").SetParent<Tag>().SetGroupName("Lte").AddConstructor<RlcTag>();
37 return tid;
38}
39
42{
43 return GetTypeId();
44}
45
48{
49 return sizeof(Time);
50}
51
52void
54{
55 int64_t senderTimestamp = m_senderTimestamp.GetNanoSeconds();
56 i.Write((const uint8_t*)&senderTimestamp, sizeof(int64_t));
57}
58
59void
61{
62 int64_t senderTimestamp;
63 i.Read((uint8_t*)&senderTimestamp, 8);
64 m_senderTimestamp = NanoSeconds(senderTimestamp);
65}
66
67void
68RlcTag::Print(std::ostream& os) const
69{
71}
72
73} // namespace ns3
Tag to calculate the per-PDU delay from eNb RLC to UE RLC.
Definition lte-rlc-tag.h:25
Time m_senderTimestamp
sender timestamp
Definition lte-rlc-tag.h:69
uint32_t GetSerializedSize() const override
RlcTag()
Create an empty RLC tag.
static TypeId GetTypeId()
Get the type ID.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void Serialize(TagBuffer i) const override
void Print(std::ostream &os) const override
void Deserialize(TagBuffer i) override
read and write tag data
Definition tag-buffer.h:41
void Read(uint8_t *buffer, uint32_t size)
void Write(const uint8_t *buffer, uint32_t size)
tag a set of bytes in a packet
Definition tag.h:28
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
int64_t GetNanoSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition nstime.h:407
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1344
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Every class exported by the ns3 library is enclosed in the ns3 namespace.