A Discrete-Event Network Simulator
API
segmentnum.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 
3 
4 /*
5 * Copyright (c) 2020 DLTLT
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 * Corresponding author: Niki Hrovatin <niki.hrovatin@famnit.upr.si>
21 */
22 
23 
24 #ifndef SEGMENTNUM_H
25 #define SEGMENTNUM_H
26 
27 #include "ns3/object-base.h"
28 #include "ns3/tag.h"
29 #include <stdint.h>
30 
31 namespace ns3 {
32 
41 class SegmentNum : public Tag
42 {
43 public:
44  static TypeId GetTypeId (void);
45  virtual TypeId GetInstanceTypeId (void) const;
46 
47  SegmentNum ();
48  SegmentNum (uint32_t seg_num);
49  ~SegmentNum ();
50 
51  uint32_t GetSegNum ();
52  void SetSegNum (uint32_t seg_num);
53 
54  virtual uint32_t GetSerializedSize (void) const;
55  virtual void Serialize (TagBuffer i) const;
56  virtual void Deserialize (TagBuffer i);
57 
58  virtual void Print (std::ostream &os) const;
59 
60  //segment number
61  uint32_t s_num;
62 };
63 
64 } // namespace ns3
65 
66 #endif /* SEGMENTNUM_H */
ns3::SegmentNum::GetSegNum
uint32_t GetSegNum()
Definition: segmentnum.cc:60
ns3
Definition: sensornode-helper.cc:26
ns3::SegmentNum::SetSegNum
void SetSegNum(uint32_t seg_num)
Definition: segmentnum.cc:65
ns3::SegmentNum::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition: segmentnum.cc:72
ns3::SegmentNum
Class for adding a tag to packets used to track different segments of packets packets are fragmented ...
Definition: segmentnum.h:41
ns3::SegmentNum::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Definition: segmentnum.cc:42
ns3::SegmentNum::Serialize
virtual void Serialize(TagBuffer i) const
Definition: segmentnum.cc:77
ns3::SegmentNum::Deserialize
virtual void Deserialize(TagBuffer i)
Definition: segmentnum.cc:82
ns3::SegmentNum::SegmentNum
SegmentNum()
Definition: segmentnum.cc:48
ns3::SegmentNum::~SegmentNum
~SegmentNum()
Definition: segmentnum.cc:58
ns3::SegmentNum::GetTypeId
static TypeId GetTypeId(void)
Definition: segmentnum.cc:31
ns3::SegmentNum::Print
virtual void Print(std::ostream &os) const
Definition: segmentnum.cc:87
ns3::SegmentNum::s_num
uint32_t s_num
Definition: segmentnum.h:61