NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
ndn-fw-hop-count-tag.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20 #include "ndn-fw-hop-count-tag.hpp"
21 
22 namespace ns3 {
23 namespace ndn {
24 
25 TypeId
27 {
28  static TypeId tid =
29  TypeId("ns3::ndn::FwHopCountTag").SetParent<Tag>().AddConstructor<FwHopCountTag>();
30  return tid;
31 }
32 
33 TypeId
35 {
36  return FwHopCountTag::GetTypeId();
37 }
38 
39 uint32_t
41 {
42  return sizeof(uint32_t);
43 }
44 
45 void
46 FwHopCountTag::Serialize(TagBuffer i) const
47 {
48  i.WriteU32(m_hopCount);
49 }
50 
51 void
53 {
54  m_hopCount = i.ReadU32();
55 }
56 
57 void
58 FwHopCountTag::Print(std::ostream& os) const
59 {
60  os << m_hopCount;
61 }
62 
63 } // namespace ndn
64 } // namespace ns3
Copyright (c) 2011-2015 Regents of the University of California.
virtual void Serialize(TagBuffer i) const
virtual void Deserialize(TagBuffer i)
virtual TypeId GetInstanceTypeId() const
Copyright (c) 2011-2015 Regents of the University of California.
virtual uint32_t GetSerializedSize() const
virtual void Print(std::ostream &os) const
static TypeId GetTypeId(void)