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