diff --git a/samples/main-packet-header.cc b/samples/main-packet-header.cc index a93c8cb87..6ba8bb3da 100644 --- a/samples/main-packet-header.cc +++ b/samples/main-packet-header.cc @@ -11,7 +11,6 @@ using namespace ns3; class MyHeader : public Header { public: - static uint32_t GetUid (void); MyHeader (); virtual ~MyHeader (); @@ -21,8 +20,7 @@ public: static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; - std::string GetName (void) const; - void Print (std::ostream &os) const; + virtual void Print (std::ostream &os) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); virtual uint32_t GetSerializedSize (void) const; @@ -52,24 +50,6 @@ MyHeader::GetInstanceTypeId (void) const return GetTypeId (); } -uint32_t -MyHeader::GetUid (void) -{ - // This string is used by the internals of the packet - // code to keep track of the packet metadata. - // You need to make sure that this string is absolutely - // unique. The code will detect any duplicate string. - static uint32_t uid = AllocateUid ("MyHeader.test.nsnam.org"); - return uid; -} - -std::string -MyHeader::GetName (void) const -{ - // This string is used to identify the type of - // my header by the packet printing routines. - return "MYHEADER"; -} void MyHeader::Print (std::ostream &os) const { diff --git a/src/common/chunk-registry.cc b/src/common/chunk-registry.cc deleted file mode 100644 index 57257a778..000000000 --- a/src/common/chunk-registry.cc +++ /dev/null @@ -1,117 +0,0 @@ -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Copyright (c) 2005 INRIA - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Mathieu Lacage - */ - -#include "chunk-registry.h" -#include "ns3/assert.h" - -namespace ns3 { - -ChunkRegistry::InfoVector * -ChunkRegistry::GetInfoVector (void) -{ - static InfoVector vec; - return &vec; -} - -std::string -ChunkRegistry::GetUidStringFromUid (uint32_t uid) -{ - InfoVector *vec = GetInfoVector (); - NS_ASSERT (uid >= 1 && uid <= vec->size ()); - Info info = (*vec)[uid - 1]; - return info.uidString; -} -uint32_t -ChunkRegistry::GetUidFromUidString (std::string uidString) -{ - uint32_t uid = 1; - InfoVector *vec = GetInfoVector (); - for (InfoVector::iterator i = vec->begin (); i != vec->end (); i++) - { - if (i->uidString == uidString) - { - return uid; - } - uid++; - } - NS_FATAL_ERROR ("Trying to access a non-registered Header or Trailer: \"" << uidString << "\". "<< - "You could try calling NS_HEADER_ENSURE_REGISTER somewhere."); - return 0; -} - -uint8_t * -ChunkRegistry::GetStaticInstance (uint32_t uid) -{ - InfoVector *vec = GetInfoVector (); - NS_ASSERT (uid >= 1 && uid <= vec->size ()); - Info info = (*vec)[uid - 1]; - return info.getStaticInstance (); -} -bool -ChunkRegistry::IsHeader (uint32_t uid) -{ - InfoVector *vec = GetInfoVector (); - NS_ASSERT (uid >= 1 && uid <= vec->size ()); - Info info = (*vec)[uid - 1]; - return info.isHeader; -} -bool -ChunkRegistry::IsTrailer (uint32_t uid) -{ - return !IsHeader (uid); -} -uint32_t -ChunkRegistry::Deserialize (uint32_t uid, uint8_t *instance, Buffer::Iterator i) -{ - InfoVector *vec = GetInfoVector (); - NS_ASSERT (uid >= 1 && uid <= vec->size ()); - Info info = (*vec)[uid - 1]; - return info.deserialize (instance, i); -} -void -ChunkRegistry::Print (uint32_t uid, uint8_t *instance, std::ostream &os) -{ - InfoVector *vec = GetInfoVector (); - NS_ASSERT (uid >= 1 && uid <= vec->size ()); - Info info = (*vec)[uid - 1]; - return info.print (instance, os); -} -std::string -ChunkRegistry::GetName (uint32_t uid, uint8_t *instance) -{ - InfoVector *vec = GetInfoVector (); - NS_ASSERT (uid >= 1 && uid <= vec->size ()); - Info info = (*vec)[uid - 1]; - return info.getName (instance); -} -void -ChunkRegistry::InvokePrintCallback (uint32_t uid, uint8_t *instance, std::ostream &os, - uint32_t packetUid, uint32_t size, - CallbackBase callback) -{ - InfoVector *vec = GetInfoVector (); - NS_ASSERT (uid >= 1 && uid <= vec->size ()); - Info info = (*vec)[uid - 1]; - info.invokePrintCallback (instance, os, packetUid, size, callback); -} - - -} // namespace ns3 diff --git a/src/common/chunk-registry.h b/src/common/chunk-registry.h deleted file mode 100644 index 7d1cce212..000000000 --- a/src/common/chunk-registry.h +++ /dev/null @@ -1,180 +0,0 @@ -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Copyright (c) 2005 INRIA - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Mathieu Lacage - */ - -#ifndef CHUNK_REGISTRY_H -#define CHUNK_REGISTRY_H - -#include -#include -#include "buffer.h" -#include "ns3/ptr.h" -#include "ns3/callback.h" - -namespace ns3 { - -/** - * \brief this registry keeps track of all different - * types of headers and trailers and assigns to each of them - * a unique integer. - * \internal - */ -class ChunkRegistry -{ -public: - template - static uint32_t RegisterHeader (std::string uuid); - template - static uint32_t RegisterTrailer (std::string uuid); - - static std::string GetUidStringFromUid (uint32_t uid); - static uint32_t GetUidFromUidString (std::string uidString); - static uint8_t *GetStaticInstance (uint32_t uid); - static uint32_t Deserialize (uint32_t uid, uint8_t *instance, Buffer::Iterator i); - static void Print (uint32_t uid, uint8_t *instance, std::ostream &os); - static std::string GetName (uint32_t uid, uint8_t *instance); - static bool IsHeader (uint32_t uid); - static bool IsTrailer (uint32_t uid); - static void InvokePrintCallback (uint32_t uid, uint8_t *instance, std::ostream &os, - uint32_t packetUid, uint32_t size, - CallbackBase callback); -private: - typedef uint8_t *(*GetStaticInstanceCb) (void); - typedef uint32_t (*DeserializeCb) (uint8_t *, Buffer::Iterator); - typedef void (*PrintCb) (uint8_t *,std::ostream &); - typedef std::string (*GetNameCb) (uint8_t *); - typedef void (*InvokePrintCallbackCb) (uint8_t *instance, std::ostream &os, - uint32_t packetUid, uint32_t size, - CallbackBase callback); - struct Info { - std::string uidString; - bool isHeader; - GetStaticInstanceCb getStaticInstance; - DeserializeCb deserialize; - PrintCb print; - GetNameCb getName; - InvokePrintCallbackCb invokePrintCallback; - }; - typedef std::vector InfoVector; - static InfoVector *GetInfoVector (void); - template - static uint8_t *DoGetStaticInstance (void); - template - static uint32_t DoDeserialize (uint8_t *instance, Buffer::Iterator i); - template - static void DoPrint (uint8_t *instance, std::ostream &os); - template - static std::string DoGetName (uint8_t *instance); - template - static void DoInvokePrintCallback (uint8_t *instance, std::ostream &os, - uint32_t packetUid, uint32_t size, - CallbackBase callback); - template - static uint32_t GetUid (bool isHeader, std::string uidString); - -}; - - -} // namespace ns3 - -namespace ns3 { - -template -uint32_t -ChunkRegistry::RegisterHeader (std::string uuid) -{ - return GetUid (true, uuid); -} -template -uint32_t -ChunkRegistry::RegisterTrailer (std::string uuid) -{ - return GetUid (false, uuid); -} - -template -uint32_t -ChunkRegistry::GetUid (bool isHeader, std::string uidString) -{ - InfoVector *vec = GetInfoVector (); - uint32_t uid = 1; - for (InfoVector::iterator i = vec->begin (); i != vec->end (); i++) - { - if (i->uidString == uidString) - { - return uid; - } - uid++; - } - Info info; - info.getStaticInstance = &ChunkRegistry::DoGetStaticInstance; - info.print = &ChunkRegistry::DoPrint; - info.getName = &ChunkRegistry::DoGetName; - info.deserialize = &ChunkRegistry::DoDeserialize; - info.invokePrintCallback = &ChunkRegistry::DoInvokePrintCallback; - info.uidString = uidString; - info.isHeader = isHeader; - vec->push_back (info); - return vec->size (); -} - -template -uint8_t * -ChunkRegistry::DoGetStaticInstance () -{ - static T instance; - return reinterpret_cast (&instance); -} -template -uint32_t -ChunkRegistry::DoDeserialize (uint8_t *instance, Buffer::Iterator i) -{ - T *obj = reinterpret_cast (instance); - return obj->Deserialize (i); -} -template -void -ChunkRegistry::DoPrint (uint8_t *instance, std::ostream &os) -{ - T *obj = reinterpret_cast (instance); - obj->Print (os); -} -template -std::string -ChunkRegistry::DoGetName (uint8_t *instance) -{ - T *obj = reinterpret_cast (instance); - return obj->GetName (); -} -template -void -ChunkRegistry::DoInvokePrintCallback (uint8_t *instance, std::ostream &os, - uint32_t packetUid, uint32_t size, - CallbackBase callback) -{ - T *obj = reinterpret_cast (instance); - Callback cb; - cb.Assign (callback); - cb (os, packetUid, size, obj); -} - -} // namespace ns3 - -#endif /* CHUNK_H */ diff --git a/src/common/header.cc b/src/common/header.cc index ef6fac914..6a17e72c3 100644 --- a/src/common/header.cc +++ b/src/common/header.cc @@ -16,4 +16,10 @@ Header::GetTypeId (void) return tid; } +std::ostream & operator << (std::ostream &os, const Header &header) +{ + header.Print (os); + return os; +} + } // namespace ns3 diff --git a/src/common/header.h b/src/common/header.h index 3d432646e..71aba7752 100644 --- a/src/common/header.h +++ b/src/common/header.h @@ -22,30 +22,9 @@ #ifndef HEADER_H #define HEADER_H -#include "chunk-registry.h" #include "ns3/object-base.h" - -/** - * \relates ns3::Header - * \brief this macro should be instantiated exactly once for each - * new type of Header - * - * This macro will ensure that your new Header type is registered - * within the packet header registry. In most cases, this macro - * is not really needed but, for safety, please, use it all the - * time. - * - * Note: This macro is _absolutely_ needed if you try to run a - * distributed simulation. - */ -#define NS_HEADER_ENSURE_REGISTERED(x) \ -static class thisisaveryverylongclassname ##x \ -{ \ - public: \ - thisisaveryverylongclassname ##x () \ - { uint32_t uid; uid = x::GetUid ();} \ -} g_thisisanotherveryveryverylongname ## x; - +#include "buffer.h" +#include namespace ns3 { @@ -57,21 +36,6 @@ namespace ns3 { * implement the following public methods: * - a default constructor: is used by the internal implementation * if the Packet class. - * - a static method named GetUid: is used to uniquely identify - * the type of each header. This method shall return a unique - * integer allocated with Header::AllocateUid. - * - a method named Print: is used by Packet::Print to print the - * content of a header as ascii data to a c++ output stream. - * Although the header is free to format its output as it - * wishes, it is recommended to follow a few rules to integrate - * with the packet pretty printer: start with flags, small field - * values located between a pair of parens. Values should be separated - * by whitespace. Follow the parens with the important fields, - * separated by whitespace. - * i.e.: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5 - * - a method named GetName: is used by Packet::Print to print - * header fragments. This method should return a user-readable - * single word as all capitalized letters. * * Sample code which shows how to create a new type of Header, and how to use it, * is shown in the sample file samples/main-packet-header.cc @@ -113,21 +77,21 @@ public: * networks. */ virtual uint32_t Deserialize (Buffer::Iterator start) = 0; -protected: - template - static uint32_t AllocateUid (std::string uuid); + /** + * This method is used by Packet::Print to print the + * content of a trailer as ascii data to a c++ output stream. + * Although the trailer is free to format its output as it + * wishes, it is recommended to follow a few rules to integrate + * with the packet pretty printer: start with flags, small field + * values located between a pair of parens. Values should be separated + * by whitespace. Follow the parens with the important fields, + * separated by whitespace. + * i.e.: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5 + */ + virtual void Print (std::ostream &os) const = 0; }; -} // namespace ns3 - -namespace ns3 { - -template -uint32_t -Header::AllocateUid (std::string uuid) -{ - return ChunkRegistry::RegisterHeader (uuid); -} +std::ostream & operator << (std::ostream &os, const Header &header); } // namespace ns3 diff --git a/src/common/packet-metadata-test.cc b/src/common/packet-metadata-test.cc index aabe3de39..e274bbc4d 100644 --- a/src/common/packet-metadata-test.cc +++ b/src/common/packet-metadata-test.cc @@ -34,13 +34,11 @@ template class HistoryHeader : public Header { public: - static TypeId GetTypeId (void); - virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); HistoryHeader (); bool IsOk (void) const; - std::string GetName (void) const; - void Print (std::ostream &os) const; + static TypeId GetTypeId (void); + virtual TypeId GetInstanceTypeId (void) const; + virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); @@ -48,6 +46,18 @@ private: bool m_ok; }; +template +HistoryHeader::HistoryHeader () + : m_ok (false) +{} + +template +bool +HistoryHeader::IsOk (void) const +{ + return m_ok; +} + template TypeId HistoryHeader::GetTypeId (void) @@ -66,38 +76,6 @@ HistoryHeader::GetInstanceTypeId (void) const { return GetTypeId (); } - -template -uint32_t -HistoryHeader::GetUid (void) -{ - std::ostringstream oss; - oss << N << "HistoryHeader.ns3"; - static uint32_t uid = AllocateUid > (oss.str()); - return uid; -} - -template -HistoryHeader::HistoryHeader () - : m_ok (false) -{} - -template -bool -HistoryHeader::IsOk (void) const -{ - return m_ok; -} - -template -std::string -HistoryHeader::GetName (void) const -{ - std::ostringstream oss; - oss << N; - return oss.str (); -} - template void HistoryHeader::Print (std::ostream &os) const @@ -135,13 +113,12 @@ template class HistoryTrailer : public Trailer { public: - static TypeId GetTypeId (void); - virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); HistoryTrailer (); bool IsOk (void) const; - std::string GetName (void) const; - void Print (std::ostream &os) const; + + static TypeId GetTypeId (void); + virtual TypeId GetInstanceTypeId (void) const; + virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); @@ -149,6 +126,17 @@ private: bool m_ok; }; +template +HistoryTrailer::HistoryTrailer () + : m_ok (false) +{} + +template +bool +HistoryTrailer::IsOk (void) const +{ + return m_ok; +} template TypeId @@ -168,38 +156,6 @@ HistoryTrailer::GetInstanceTypeId (void) const { return GetTypeId (); } - -template -uint32_t -HistoryTrailer::GetUid (void) -{ - std::ostringstream oss; - oss << N << "HistoryTrailer.ns3"; - static uint32_t uid = AllocateUid > (oss.str ()); - return uid; -} - - -template -HistoryTrailer::HistoryTrailer () - : m_ok (false) -{} - -template -bool -HistoryTrailer::IsOk (void) const -{ - return m_ok; -} - -template -std::string -HistoryTrailer::GetName (void) const -{ - std::ostringstream oss; - oss << N; - return oss.str (); -} template void HistoryTrailer::Print (std::ostream &os) const diff --git a/src/common/trailer.cc b/src/common/trailer.cc index 389e3d34b..98cdaa6b6 100644 --- a/src/common/trailer.cc +++ b/src/common/trailer.cc @@ -16,4 +16,10 @@ Trailer::GetTypeId (void) return tid; } +std::ostream & operator << (std::ostream &os, const Trailer &trailer) +{ + trailer.Print (os); + return os; +} + } // namespace ns3 diff --git a/src/common/trailer.h b/src/common/trailer.h index dd77e684b..f515211eb 100644 --- a/src/common/trailer.h +++ b/src/common/trailer.h @@ -23,30 +23,9 @@ #define TRAILER_H #include "ns3/object-base.h" -#include "chunk-registry.h" #include "buffer.h" #include -/** - * \relates ns3::Trailer - * \brief this macro should be instantiated exactly once for each - * new type of Trailer - * - * This macro will ensure that your new Trailer type is registered - * within the packet trailer registry. In most cases, this macro - * is not really needed but, for safety, please, use it all the - * time. - * - * Note: This macro is _absolutely_ needed if you try to run a - * distributed simulation. - */ -#define NS_TRAILER_ENSURE_REGISTERED(x) \ -static class thisisaveryverylongclassname ##x \ -{ \ - public: \ - thisisaveryverylongclassname ##x () \ - { uint32_t uid; uid = x::GetUid ();} \ -} g_thisisanotherveryveryverylongname ##x; namespace ns3 { @@ -58,22 +37,6 @@ namespace ns3 { * implement the following public methods: * - a default constructor: is used by the internal implementation * if the Packet class. - * - a static method named GetUid: is used to uniquely identify - * the type of each trailer. This method shall return a unique - * integer allocated with Trailer::AllocateUid. - * - a method named Print: is used by Packet::Print to print the - * content of a trailer as ascii data to a c++ output stream. - * Although the trailer is free to format its output as it - * wishes, it is recommended to follow a few rules to integrate - * with the packet pretty printer: start with flags, small field - * values located between a pair of parens. Values should be separated - * by whitespace. Follow the parens with the important fields, - * separated by whitespace. - * i.e.: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5 - * - a method named GetName: is used by Packet::Print to print - * trailer fragments. This method should return a user-readable - * single word as all capitalized letters. - * */ class Trailer : public ObjectBase { @@ -116,22 +79,21 @@ public: * Buffer::Iterator::Prev prio to actually reading any data. */ virtual uint32_t Deserialize (Buffer::Iterator end) = 0; -protected: - template - static uint32_t AllocateUid (std::string uidString); + /** + * This method is used by Packet::Print to print the + * content of a trailer as ascii data to a c++ output stream. + * Although the trailer is free to format its output as it + * wishes, it is recommended to follow a few rules to integrate + * with the packet pretty printer: start with flags, small field + * values located between a pair of parens. Values should be separated + * by whitespace. Follow the parens with the important fields, + * separated by whitespace. + * i.e.: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5 + */ + virtual void Print (std::ostream &os) const = 0; }; -} // namespace ns3 - -namespace ns3 { - -template -uint32_t -Trailer::AllocateUid (std::string uidString) -{ - return ChunkRegistry::RegisterTrailer (uidString); -} - +std::ostream & operator << (std::ostream &os, const Trailer &trailer); } // namespace ns3 diff --git a/src/common/wscript b/src/common/wscript index 1de57f8ac..13a27d50b 100644 --- a/src/common/wscript +++ b/src/common/wscript @@ -4,7 +4,6 @@ def build(bld): common = bld.create_ns3_module('common', ['core', 'simulator']) common.source = [ 'buffer.cc', - 'chunk-registry.cc', 'packet-metadata.cc', 'packet-metadata-test.cc', 'packet.cc', @@ -21,7 +20,6 @@ def build(bld): headers.module = 'common' headers.source = [ 'buffer.h', - 'chunk-registry.h', 'header.h', 'trailer.h', 'tags.h', diff --git a/src/devices/wifi/mgt-headers.cc b/src/devices/wifi/mgt-headers.cc index e3c7aeac0..87857bfd7 100644 --- a/src/devices/wifi/mgt-headers.cc +++ b/src/devices/wifi/mgt-headers.cc @@ -74,17 +74,6 @@ MgtProbeRequestHeader::GetInstanceTypeId (void) const { return GetTypeId (); } -uint32_t -MgtProbeRequestHeader::GetUid (void) -{ - static uint32_t uid = AllocateUid ("MgtProbeRequestHeader.ns3.inria.fr"); - return uid; -} -std::string -MgtProbeRequestHeader::GetName (void) const -{ - return "PROBEREQ"; -} void MgtProbeRequestHeader::Print (std::ostream &os) const { @@ -164,17 +153,6 @@ MgtProbeResponseHeader::GetInstanceTypeId (void) const return GetTypeId (); } uint32_t -MgtProbeResponseHeader::GetUid (void) -{ - static uint32_t uid = AllocateUid ("MgtProbeResponseHeader.ns3.inria.fr"); - return uid; -} -std::string -MgtProbeResponseHeader::GetName (void) const -{ - return "PROBERESP"; -} -uint32_t MgtProbeResponseHeader::GetSerializedSize (void) const { uint32_t size = 0; @@ -283,17 +261,6 @@ MgtAssocRequestHeader::GetInstanceTypeId (void) const { return GetTypeId (); } -uint32_t -MgtAssocRequestHeader::GetUid (void) -{ - static uint32_t uid = AllocateUid ("MgtAssocRequestHeader.ns3.inria.fr"); - return uid; -} -std::string -MgtAssocRequestHeader::GetName (void) const -{ - return "ASSOCREQ"; -} uint32_t MgtAssocRequestHeader::GetSerializedSize (void) const { @@ -376,17 +343,6 @@ MgtAssocResponseHeader::GetInstanceTypeId (void) const return GetTypeId (); } uint32_t -MgtAssocResponseHeader::GetUid (void) -{ - static uint32_t uid = AllocateUid ("MgtAssocResponseHeader.ns3.inria.fr"); - return uid; -} -std::string -MgtAssocResponseHeader::GetName (void) const -{ - return "ASSOCRESP"; -} -uint32_t MgtAssocResponseHeader::GetSerializedSize (void) const { uint32_t size = 0; diff --git a/src/devices/wifi/mgt-headers.h b/src/devices/wifi/mgt-headers.h index 67e8a315a..45996600e 100644 --- a/src/devices/wifi/mgt-headers.h +++ b/src/devices/wifi/mgt-headers.h @@ -46,9 +46,7 @@ public: static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); - std::string GetName (void) const; - void Print (std::ostream &os) const; + virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); @@ -73,9 +71,7 @@ public: static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); - std::string GetName (void) const; - void Print (std::ostream &os) const; + virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); @@ -98,9 +94,7 @@ public: static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); - std::string GetName (void) const; - void Print (std::ostream &os) const; + virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); @@ -125,9 +119,7 @@ public: static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); - std::string GetName (void) const; - void Print (std::ostream &os) const; + virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); diff --git a/src/devices/wifi/wifi-mac-header.cc b/src/devices/wifi/wifi-mac-header.cc index e8e8324f8..60e680f71 100644 --- a/src/devices/wifi/wifi-mac-header.cc +++ b/src/devices/wifi/wifi-mac-header.cc @@ -781,18 +781,6 @@ WifiMacHeader::GetInstanceTypeId (void) const { return GetTypeId (); } -uint32_t -WifiMacHeader::GetUid (void) -{ - static uint32_t uid = AllocateUid ("WifiMacHeader.ns3.inria.fr"); - return uid; -} - -std::string -WifiMacHeader::GetName (void) const -{ - return "802.11"; -} void WifiMacHeader::PrintFrameControl (std::ostream &os) const diff --git a/src/devices/wifi/wifi-mac-header.h b/src/devices/wifi/wifi-mac-header.h index 869a48628..33eedd8dd 100644 --- a/src/devices/wifi/wifi-mac-header.h +++ b/src/devices/wifi/wifi-mac-header.h @@ -71,9 +71,7 @@ public: static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); - std::string GetName (void) const; - void Print (std::ostream &os) const; + virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); diff --git a/src/devices/wifi/wifi-mac-trailer.cc b/src/devices/wifi/wifi-mac-trailer.cc index d083e0509..ab156dda5 100644 --- a/src/devices/wifi/wifi-mac-trailer.cc +++ b/src/devices/wifi/wifi-mac-trailer.cc @@ -44,19 +44,6 @@ WifiMacTrailer::GetInstanceTypeId (void) const return GetTypeId (); } -uint32_t -WifiMacTrailer::GetUid (void) -{ - static uint32_t uid = AllocateUid ("WifiMacTrailer.ns3.inria.fr"); - return uid; -} - -std::string -WifiMacTrailer::GetName (void) const -{ - return "802.11 FCS"; -} - void WifiMacTrailer::Print (std::ostream &os) const {} diff --git a/src/devices/wifi/wifi-mac-trailer.h b/src/devices/wifi/wifi-mac-trailer.h index c295025c7..717c12d70 100644 --- a/src/devices/wifi/wifi-mac-trailer.h +++ b/src/devices/wifi/wifi-mac-trailer.h @@ -33,9 +33,7 @@ public: static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); - std::string GetName (void) const; - void Print (std::ostream &os) const; + virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); diff --git a/src/internet-node/arp-header.cc b/src/internet-node/arp-header.cc index 3e114716c..0ff15bd1d 100644 --- a/src/internet-node/arp-header.cc +++ b/src/internet-node/arp-header.cc @@ -25,30 +25,8 @@ namespace ns3 { -NS_HEADER_ENSURE_REGISTERED (ArpHeader); NS_OBJECT_ENSURE_REGISTERED (ArpHeader); -TypeId -ArpHeader::GetTypeId (void) -{ - static TypeId tid = TypeId ("ns3::ArpHeader") - .SetParent
() - ; - return tid; -} -TypeId -ArpHeader::GetInstanceTypeId (void) const -{ - return GetTypeId (); -} - -uint32_t -ArpHeader::GetUid (void) -{ - static uint32_t uid = AllocateUid ("ArpHeader.ns3"); - return uid; -} - void ArpHeader::SetRequest (Address sourceHardwareAddress, Ipv4Address sourceProtocolAddress, @@ -104,12 +82,20 @@ ArpHeader::GetDestinationIpv4Address (void) return m_ipv4Dest; } -std::string -ArpHeader::GetName (void) const -{ - return "ARP"; -} +TypeId +ArpHeader::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::ArpHeader") + .SetParent
() + ; + return tid; +} +TypeId +ArpHeader::GetInstanceTypeId (void) const +{ + return GetTypeId (); +} void ArpHeader::Print (std::ostream &os) const { diff --git a/src/internet-node/arp-header.h b/src/internet-node/arp-header.h index 7fafefcef..96b368b0b 100644 --- a/src/internet-node/arp-header.h +++ b/src/internet-node/arp-header.h @@ -34,10 +34,6 @@ namespace ns3 { class ArpHeader : public Header { public: - static TypeId GetTypeId (void); - virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); - void SetRequest (Address sourceHardwareAddress, Ipv4Address sourceProtocolAddress, Address destinationHardwareAddress, @@ -53,11 +49,12 @@ public: Ipv4Address GetSourceIpv4Address (void); Ipv4Address GetDestinationIpv4Address (void); - std::string GetName (void) const; - void Print (std::ostream &os) const; - uint32_t GetSerializedSize (void) const; - void Serialize (Buffer::Iterator start) const; - uint32_t Deserialize (Buffer::Iterator start); + static TypeId GetTypeId (void); + virtual TypeId GetInstanceTypeId (void) const; + virtual void Print (std::ostream &os) const; + virtual uint32_t GetSerializedSize (void) const; + virtual void Serialize (Buffer::Iterator start) const; + virtual uint32_t Deserialize (Buffer::Iterator start); enum ArpType_e { ARP_TYPE_REQUEST = 1, diff --git a/src/internet-node/ipv4-header.cc b/src/internet-node/ipv4-header.cc index 052be7c5a..e8296018f 100644 --- a/src/internet-node/ipv4-header.cc +++ b/src/internet-node/ipv4-header.cc @@ -28,32 +28,10 @@ NS_LOG_COMPONENT_DEFINE ("Ipv4Header"); namespace ns3 { -NS_HEADER_ENSURE_REGISTERED (Ipv4Header); NS_OBJECT_ENSURE_REGISTERED (Ipv4Header); bool Ipv4Header::m_calcChecksum = false; -TypeId -Ipv4Header::GetTypeId (void) -{ - static TypeId tid = TypeId ("ns3::Ipv4Header") - .SetParent
() - ; - return tid; -} -TypeId -Ipv4Header::GetInstanceTypeId (void) const -{ - return GetTypeId (); -} - -uint32_t -Ipv4Header::GetUid (void) -{ - static uint32_t uid = AllocateUid ("Ipv4Header.ns3"); - return uid; -} - Ipv4Header::Ipv4Header () : m_payloadSize (0), m_identification (0), @@ -201,12 +179,20 @@ Ipv4Header::IsChecksumOk (void) const return m_goodChecksum; } -std::string -Ipv4Header::GetName (void) const -{ - return "IPV4"; -} +TypeId +Ipv4Header::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::Ipv4Header") + .SetParent
() + ; + return tid; +} +TypeId +Ipv4Header::GetInstanceTypeId (void) const +{ + return GetTypeId (); +} void Ipv4Header::Print (std::ostream &os) const { diff --git a/src/internet-node/ipv4-header.h b/src/internet-node/ipv4-header.h index 8375dd300..6ea749046 100644 --- a/src/internet-node/ipv4-header.h +++ b/src/internet-node/ipv4-header.h @@ -32,9 +32,6 @@ namespace ns3 { class Ipv4Header : public Header { public: - static TypeId GetTypeId (void); - virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); /** * \brief Construct a null IPv4 header */ @@ -142,8 +139,9 @@ public: */ bool IsChecksumOk (void) const; - std::string GetName (void) const; - void Print (std::ostream &os) const; + static TypeId GetTypeId (void); + virtual TypeId GetInstanceTypeId (void) const; + virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); diff --git a/src/internet-node/tcp-header.cc b/src/internet-node/tcp-header.cc index dde46f36c..989b9680e 100644 --- a/src/internet-node/tcp-header.cc +++ b/src/internet-node/tcp-header.cc @@ -26,32 +26,10 @@ namespace ns3 { -NS_HEADER_ENSURE_REGISTERED (TcpHeader); NS_OBJECT_ENSURE_REGISTERED (TcpHeader); bool TcpHeader::m_calcChecksum = false; -TypeId -TcpHeader::GetTypeId (void) -{ - static TypeId tid = TypeId ("ns3::TcpHeader") - .SetParent
() - ; - return tid; -} -TypeId -TcpHeader::GetInstanceTypeId (void) const -{ - return GetTypeId (); -} - -uint32_t -TcpHeader::GetUid (void) -{ - static uint32_t uid = AllocateUid ("TcpHeader.ns3"); - return uid; -} - TcpHeader::TcpHeader () : m_sourcePort (0), m_destinationPort (0), @@ -156,12 +134,19 @@ TcpHeader::InitializeChecksum (Ipv4Address source, //XXX requires peeking into IP to get length of the TCP segment } -std::string -TcpHeader::GetName (void) const +TypeId +TcpHeader::GetTypeId (void) { - return "TCP"; + static TypeId tid = TypeId ("ns3::TcpHeader") + .SetParent
() + ; + return tid; +} +TypeId +TcpHeader::GetInstanceTypeId (void) const +{ + return GetTypeId (); } - void TcpHeader::Print (std::ostream &os) const { //XXX diff --git a/src/internet-node/tcp-header.h b/src/internet-node/tcp-header.h index 2dbda5634..3181b03be 100644 --- a/src/internet-node/tcp-header.h +++ b/src/internet-node/tcp-header.h @@ -33,10 +33,6 @@ namespace ns3 { class TcpHeader : public Header { public: - static TypeId GetTypeId (void); - virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); - TcpHeader (); virtual ~TcpHeader (); @@ -139,8 +135,9 @@ public: typedef enum { NONE = 0, FIN = 1, SYN = 2, RST = 4, PSH = 8, ACK = 16, URG = 32} Flags_t; - std::string GetName (void) const; - void Print (std::ostream &os) const; + static TypeId GetTypeId (void); + virtual TypeId GetInstanceTypeId (void) const; + virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); diff --git a/src/internet-node/udp-header.cc b/src/internet-node/udp-header.cc index d8b3594c7..7682ae880 100644 --- a/src/internet-node/udp-header.cc +++ b/src/internet-node/udp-header.cc @@ -24,32 +24,10 @@ namespace ns3 { -NS_HEADER_ENSURE_REGISTERED (UdpHeader); NS_OBJECT_ENSURE_REGISTERED (UdpHeader); bool UdpHeader::m_calcChecksum = false; -TypeId -UdpHeader::GetTypeId (void) -{ - static TypeId tid = TypeId ("ns3::UdpHeader") - .SetParent
() - ; - return tid; -} -TypeId -UdpHeader::GetInstanceTypeId (void) const -{ - return GetTypeId (); -} - -uint32_t -UdpHeader::GetUid (void) -{ - static uint32_t uid = AllocateUid ("UdpHeader.ns3"); - return uid; -} - /* The magic values below are used only for debugging. * They can be used to easily detect memory corruption * problems so you can see the patterns in memory. @@ -115,12 +93,19 @@ UdpHeader::InitializeChecksum (Ipv4Address source, m_initialChecksum = Ipv4ChecksumCalculate (0, buf, 12); } -std::string -UdpHeader::GetName (void) const +TypeId +UdpHeader::GetTypeId (void) { - return "UDP"; + static TypeId tid = TypeId ("ns3::UdpHeader") + .SetParent
() + ; + return tid; +} +TypeId +UdpHeader::GetInstanceTypeId (void) const +{ + return GetTypeId (); } - void UdpHeader::Print (std::ostream &os) const { diff --git a/src/internet-node/udp-header.h b/src/internet-node/udp-header.h index f55f42406..c0e5a023e 100644 --- a/src/internet-node/udp-header.h +++ b/src/internet-node/udp-header.h @@ -34,9 +34,6 @@ namespace ns3 { class UdpHeader : public Header { public: - static TypeId GetTypeId (void); - virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); /** * \brief Constructor @@ -86,8 +83,9 @@ public: Ipv4Address destination, uint8_t protocol); - std::string GetName (void) const; - void Print (std::ostream &os) const; + static TypeId GetTypeId (void); + virtual TypeId GetInstanceTypeId (void) const; + virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); diff --git a/src/node/ethernet-header.cc b/src/node/ethernet-header.cc index 999dc9d08..45b90f478 100644 --- a/src/node/ethernet-header.cc +++ b/src/node/ethernet-header.cc @@ -31,30 +31,8 @@ NS_LOG_COMPONENT_DEFINE ("EthernetHeader"); namespace ns3 { -NS_HEADER_ENSURE_REGISTERED (EthernetHeader); NS_OBJECT_ENSURE_REGISTERED (EthernetHeader); -TypeId -EthernetHeader::GetTypeId (void) -{ - static TypeId tid = TypeId ("ns3::EthernetHeader") - .SetParent
() - ; - return tid; -} -TypeId -EthernetHeader::GetInstanceTypeId (void) const -{ - return GetTypeId (); -} - -uint32_t -EthernetHeader::GetUid (void) -{ - static uint32_t uid = AllocateUid ("EthernetHeader.ns3"); - return uid; -} - EthernetHeader::EthernetHeader (bool hasPreamble) : m_enPreambleSfd (hasPreamble), m_lengthType (0) @@ -121,12 +99,20 @@ EthernetHeader::GetHeaderSize (void) const return GetSerializedSize(); } -std::string -EthernetHeader::GetName (void) const -{ - return "ETHERNET"; -} +TypeId +EthernetHeader::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::EthernetHeader") + .SetParent
() + ; + return tid; +} +TypeId +EthernetHeader::GetInstanceTypeId (void) const +{ + return GetTypeId (); +} void EthernetHeader::Print (std::ostream &os) const { diff --git a/src/node/ethernet-header.h b/src/node/ethernet-header.h index 189cb8e32..8434a3fca 100644 --- a/src/node/ethernet-header.h +++ b/src/node/ethernet-header.h @@ -49,9 +49,6 @@ namespace ns3 { class EthernetHeader : public Header { public: - static TypeId GetTypeId (void); - virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); /** * \brief Construct a null ethernet header @@ -105,8 +102,9 @@ public: */ uint32_t GetHeaderSize() const; - std::string GetName (void) const; - void Print (std::ostream &os) const; + static TypeId GetTypeId (void); + virtual TypeId GetInstanceTypeId (void) const; + virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); diff --git a/src/node/ethernet-trailer.cc b/src/node/ethernet-trailer.cc index 6c94ed368..e1c0396f8 100644 --- a/src/node/ethernet-trailer.cc +++ b/src/node/ethernet-trailer.cc @@ -28,32 +28,10 @@ NS_LOG_COMPONENT_DEFINE ("EthernetTrailer"); namespace ns3 { -NS_TRAILER_ENSURE_REGISTERED (EthernetTrailer); NS_OBJECT_ENSURE_REGISTERED (EthernetTrailer); bool EthernetTrailer::m_calcFcs = false; -TypeId -EthernetTrailer::GetTypeId (void) -{ - static TypeId tid = TypeId ("ns3::EthernetTrailer") - .SetParent () - ; - return tid; -} -TypeId -EthernetTrailer::GetInstanceTypeId (void) const -{ - return GetTypeId (); -} - -uint32_t -EthernetTrailer::GetUid (void) -{ - static uint32_t uid = AllocateUid ("EthernetTrailer.ns3"); - return uid; -} - EthernetTrailer::EthernetTrailer () { Init(); @@ -76,7 +54,9 @@ EthernetTrailer::CheckFcs (Ptr p) const if (!m_calcFcs) { return true; - } else { + } + else + { NS_LOG_WARN ("FCS calculation is not yet enabled"); return false; } @@ -105,12 +85,20 @@ EthernetTrailer::GetTrailerSize (void) const { return GetSerializedSize(); } -std::string -EthernetTrailer::GetName (void) const -{ - return "ETHERNET"; -} +TypeId +EthernetTrailer::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::EthernetTrailer") + .SetParent () + ; + return tid; +} +TypeId +EthernetTrailer::GetInstanceTypeId (void) const +{ + return GetTypeId (); +} void EthernetTrailer::Print (std::ostream &os) const { diff --git a/src/node/ethernet-trailer.h b/src/node/ethernet-trailer.h index 694be0a70..5a21523b0 100644 --- a/src/node/ethernet-trailer.h +++ b/src/node/ethernet-trailer.h @@ -39,10 +39,6 @@ class Packet; class EthernetTrailer : public Trailer { public: - static TypeId GetTypeId (void); - virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); - /** * \brief Construct a null ethernet trailer */ @@ -85,11 +81,12 @@ public: */ uint32_t GetTrailerSize() const; - std::string GetName (void) const; - void Print (std::ostream &os) const; - uint32_t GetSerializedSize (void) const; - void Serialize (Buffer::Iterator end) const; - uint32_t Deserialize (Buffer::Iterator end); + static TypeId GetTypeId (void); + virtual TypeId GetInstanceTypeId (void) const; + virtual void Print (std::ostream &os) const; + virtual uint32_t GetSerializedSize (void) const; + virtual void Serialize (Buffer::Iterator end) const; + virtual uint32_t Deserialize (Buffer::Iterator end); private: /** diff --git a/src/node/llc-snap-header.cc b/src/node/llc-snap-header.cc index 9c801fbc0..51880a2bc 100644 --- a/src/node/llc-snap-header.cc +++ b/src/node/llc-snap-header.cc @@ -25,30 +25,8 @@ namespace ns3 { -NS_HEADER_ENSURE_REGISTERED (LlcSnapHeader); NS_OBJECT_ENSURE_REGISTERED (LlcSnapHeader); -TypeId -LlcSnapHeader::GetTypeId (void) -{ - static TypeId tid = TypeId ("ns3::LlcSnapHeader") - .SetParent
() - ; - return tid; -} -TypeId -LlcSnapHeader::GetInstanceTypeId (void) const -{ - return GetTypeId (); -} - -uint32_t -LlcSnapHeader::GetUid (void) -{ - static uint32_t uid = AllocateUid ("LlcSnapHeader.ns3"); - return uid; -} - LlcSnapHeader::LlcSnapHeader () {} @@ -69,12 +47,19 @@ LlcSnapHeader::GetSerializedSize (void) const return 1 + 1 + 1 + 3 + 2; } -std::string -LlcSnapHeader::GetName (void) const +TypeId +LlcSnapHeader::GetTypeId (void) { - return "LLCSNAP"; + static TypeId tid = TypeId ("ns3::LlcSnapHeader") + .SetParent
() + ; + return tid; +} +TypeId +LlcSnapHeader::GetInstanceTypeId (void) const +{ + return GetTypeId (); } - void LlcSnapHeader::Print (std::ostream &os) const { diff --git a/src/node/llc-snap-header.h b/src/node/llc-snap-header.h index 32c20a484..1d70d4740 100644 --- a/src/node/llc-snap-header.h +++ b/src/node/llc-snap-header.h @@ -31,17 +31,14 @@ namespace ns3 { class LlcSnapHeader : public Header { public: - static TypeId GetTypeId (void); - virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); - LlcSnapHeader (); void SetType (uint16_t type); uint16_t GetType (void); - std::string GetName (void) const; - void Print (std::ostream &os) const; + static TypeId GetTypeId (void); + virtual TypeId GetInstanceTypeId (void) const; + virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); diff --git a/src/routing/olsr/olsr-header.cc b/src/routing/olsr/olsr-header.cc index eb488234a..bc4c3a17b 100644 --- a/src/routing/olsr/olsr-header.cc +++ b/src/routing/olsr/olsr-header.cc @@ -116,14 +116,6 @@ PacketHeader::GetInstanceTypeId (void) const return GetTypeId (); } -uint32_t -PacketHeader::GetUid (void) -{ - static uint32_t uid = AllocateUid - ("PacketHeader.nsnam.org"); - return uid; -} - uint32_t PacketHeader::GetSerializedSize (void) const { @@ -179,14 +171,6 @@ MessageHeader::GetInstanceTypeId (void) const return GetTypeId (); } -uint32_t -MessageHeader::GetUid (void) -{ - static uint32_t uid = AllocateUid - ("MessageHeader.nsnam.org"); - return uid; -} - uint32_t MessageHeader::GetSerializedSize (void) const { diff --git a/src/routing/olsr/olsr-header.h b/src/routing/olsr/olsr-header.h index 13583d16e..e1579e898 100644 --- a/src/routing/olsr/olsr-header.h +++ b/src/routing/olsr/olsr-header.h @@ -97,12 +97,10 @@ private: public: static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); - virtual std::string GetName (void) const { return "OlsrPacket"; } }; @@ -204,12 +202,10 @@ private: public: static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; - static uint32_t GetUid (void); virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); - virtual std::string GetName (void) const { return "OlsrMessage"; } // 5.1. MID Message Format // diff --git a/utils/bench-packets.cc b/utils/bench-packets.cc index 920aa992b..099882085 100644 --- a/utils/bench-packets.cc +++ b/utils/bench-packets.cc @@ -35,9 +35,7 @@ public: 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; + virtual void Print (std::ostream &os) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); @@ -75,23 +73,6 @@ BenchHeader::GetInstanceTypeId (void) const return GetTypeId (); } -template -uint32_t -BenchHeader::GetUid (void) -{ - static uint32_t uid = AllocateUid > (GetName ()); - return uid; -} - -template -std::string -BenchHeader::GetName (void) -{ - std::ostringstream oss; - oss << "BenchHeader" << N; - return oss.str (); -} - template void BenchHeader::Print (std::ostream &os) const