NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ndn-fw-hop-count-tag.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20 #ifndef NDN_FW_HOP_COUNT_TAG_H
21 #define NDN_FW_HOP_COUNT_TAG_H
22 
23 #include "ns3/tag.h"
24 
25 namespace ns3 {
26 namespace ndn {
27 
32 class FwHopCountTag : public Tag {
33 public:
34  static TypeId
35  GetTypeId(void);
36 
41  : m_hopCount(0){};
42 
47  {
48  }
49 
53  void
55  {
56  m_hopCount++;
57  }
58 
62  uint32_t
63  Get() const
64  {
65  return m_hopCount;
66  }
67 
69  // from ObjectBase
71  virtual TypeId
72  GetInstanceTypeId() const;
73 
75  // from Tag
77 
78  virtual uint32_t
79  GetSerializedSize() const;
80 
81  virtual void
82  Serialize(TagBuffer i) const;
83 
84  virtual void
85  Deserialize(TagBuffer i);
86 
87  virtual void
88  Print(std::ostream& os) const;
89 
90 private:
91  uint32_t m_hopCount;
92 };
93 
94 } // namespace ndn
95 } // namespace ns3
96 
97 #endif // NDN_FW_HOP_COUNT_TAG_H
FwHopCountTag()
Default constructor.
Packet tag that is used to track hop count for Interest-Data pairs.
virtual void Serialize(TagBuffer i) const
virtual void Deserialize(TagBuffer i)
virtual TypeId GetInstanceTypeId() const
uint32_t Get() const
Get value of hop count.
virtual uint32_t GetSerializedSize() const
void Increment()
Increment hop count.
virtual void Print(std::ostream &os) const
static TypeId GetTypeId(void)