A Discrete-Event Network Simulator
API
seq-ts-size-header.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 INRIA
3 * Copyright (c) 2018 Natale Patriciello <natale.patriciello@gmail.com>
4 * (added timestamp and size fields)
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation;
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef SEQ_TS_SIZE_HEADER_H
21#define SEQ_TS_SIZE_HEADER_H
22
23#include <ns3/seq-ts-header.h>
24
25namespace ns3
26{
38{
39 public:
44 static TypeId GetTypeId();
45
50
55 void SetSize(uint64_t size);
56
61 uint64_t GetSize() const;
62
63 // Inherited
64 TypeId GetInstanceTypeId() const override;
65 void Print(std::ostream& os) const override;
66 uint32_t GetSerializedSize() const override;
67 void Serialize(Buffer::Iterator start) const override;
69
70 private:
71 uint64_t m_size{0};
72};
73
74} // namespace ns3
75
76#endif /* SEQ_TS_SIZE_HEADER */
iterator in a Buffer instance
Definition: buffer.h:100
Packet header to carry sequence number and timestamp.
Definition: seq-ts-header.h:45
Header with a sequence, a timestamp, and a "size" attribute.
uint32_t GetSerializedSize() const override
uint64_t GetSize() const
Get the size information that the header is carrying.
uint32_t Deserialize(Buffer::Iterator start) override
void Print(std::ostream &os) const override
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
static TypeId GetTypeId()
Get the type ID.
void Serialize(Buffer::Iterator start) const override
void SetSize(uint64_t size)
Set the size information that the header will carry.
uint64_t m_size
The 'size' information that the header is carrying.
a unique identifier for an interface.
Definition: type-id.h:60
Every class exported by the ns3 library is enclosed in the ns3 namespace.
def start()
Definition: core.py:1864