utils/bench-packets.cc
changeset 2643 2a3324f4dabe
parent 1869 9e5d8b4893b2
child 2646 c1fef7686472
--- a/utils/bench-packets.cc	Mon Mar 17 12:12:17 2008 -0700
+++ b/utils/bench-packets.cc	Mon Mar 17 13:12:17 2008 -0700
@@ -33,13 +33,14 @@
   BenchHeader ();
   bool IsOk (void) const;
 
+  static TypeId GetTypeId (void);
+  virtual TypeId GetInstanceTypeId (void) const;
   static uint32_t GetUid (void);
-
   static std::string GetName (void);
   void Print (std::ostream &os) const;
-  uint32_t GetSerializedSize (void) const;
-  void Serialize (Buffer::Iterator start) const;
-  uint32_t Deserialize (Buffer::Iterator start);
+  virtual uint32_t GetSerializedSize (void) const;
+  virtual void Serialize (Buffer::Iterator start) const;
+  virtual uint32_t Deserialize (Buffer::Iterator start);
 private:
   bool m_ok;
 };
@@ -57,6 +58,24 @@
 }
 
 template <int N>
+TypeId 
+BenchHeader<N>::GetTypeId (void)
+{
+  std::ostringstream oss;
+  oss << "ns3::BenchHeader<"<<N<<">";
+  static TypeId tid = TypeId (oss.str ().c_str ())
+    .SetParent<Header> ()
+    ;
+  return tid;
+}
+template <int N>
+TypeId 
+BenchHeader<N>::GetInstanceTypeId (void) const
+{
+  return GetTypeId ();
+}
+
+template <int N>
 uint32_t 
 BenchHeader<N>::GetUid (void)
 {