A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
timestamp-tag.h
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License version 2 as
4
* published by the Free Software Foundation;
5
*
6
* This program is distributed in the hope that it will be useful,
7
* but WITHOUT ANY WARRANTY; without even the implied warranty of
8
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
* GNU General Public License for more details.
10
*
11
* You should have received a copy of the GNU General Public License
12
* along with this program; if not, write to the Free Software
13
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14
*
15
* Authors: Joe Kopena <tjkopena@cs.drexel.edu>
16
*/
17
18
#ifndef TIMESTAMP_TAG_H
19
#define TIMESTAMP_TAG_H
20
21
#include "ns3/nstime.h"
22
#include "ns3/tag-buffer.h"
23
#include "ns3/tag.h"
24
#include "ns3/type-id.h"
25
26
#include <iostream>
27
28
namespace
ns3
29
{
30
38
class
TimestampTag
:
public
Tag
39
{
40
public
:
45
static
TypeId
GetTypeId
();
46
TypeId
GetInstanceTypeId
()
const override
;
47
51
TimestampTag
();
52
57
TimestampTag
(
Time
timestamp);
58
59
void
Serialize
(
TagBuffer
i)
const override
;
60
void
Deserialize
(
TagBuffer
i)
override
;
61
uint32_t
GetSerializedSize
()
const override
;
62
void
Print
(std::ostream& os)
const override
;
63
68
Time
GetTimestamp
()
const
;
69
74
void
SetTimestamp
(
Time
timestamp);
75
76
private
:
77
Time
m_timestamp
{0};
78
};
79
80
}
// namespace ns3
81
82
#endif
// TIMESTAMP_TAG_H
ns3::TagBuffer
read and write tag data
Definition:
tag-buffer.h:52
ns3::Tag
tag a set of bytes in a packet
Definition:
tag.h:39
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
ns3::TimestampTag
Timestamp tag for associating a timestamp with a packet.
Definition:
timestamp-tag.h:39
ns3::TimestampTag::Deserialize
void Deserialize(TagBuffer i) override
Definition:
timestamp-tag.cc:67
ns3::TimestampTag::m_timestamp
Time m_timestamp
Timestamp.
Definition:
timestamp-tag.h:77
ns3::TimestampTag::SetTimestamp
void SetTimestamp(Time timestamp)
Set the Timestamp object.
Definition:
timestamp-tag.cc:85
ns3::TimestampTag::Print
void Print(std::ostream &os) const override
Definition:
timestamp-tag.cc:73
ns3::TimestampTag::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition:
timestamp-tag.cc:55
ns3::TimestampTag::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
timestamp-tag.cc:39
ns3::TimestampTag::Serialize
void Serialize(TagBuffer i) const override
Definition:
timestamp-tag.cc:61
ns3::TimestampTag::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition:
timestamp-tag.cc:49
ns3::TimestampTag::TimestampTag
TimestampTag()
Construct a new TimestampTag object.
ns3::TimestampTag::GetTimestamp
Time GetTimestamp() const
Get the Timestamp object.
Definition:
timestamp-tag.cc:79
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
network
utils
timestamp-tag.h
Generated on Sun Mar 3 2024 17:11:06 for ns-3 by
1.9.1