diff -r b0f12f3a75b3 -r 5962e2962fa9 src/devices/wifi/mac-low.cc --- a/src/devices/wifi/mac-low.cc Thu Apr 24 15:44:15 2008 -0700 +++ b/src/devices/wifi/mac-low.cc Thu Apr 24 15:44:35 2008 -0700 @@ -21,7 +21,7 @@ #include "ns3/assert.h" #include "ns3/packet.h" #include "ns3/simulator.h" -#include "ns3/tag.h" +#include "ns3/mtag.h" #include "ns3/log.h" #include "ns3/node.h" @@ -37,17 +37,16 @@ namespace ns3 { -class SnrTag : public Tag +class SnrTag : public Mtag { public: - SnrTag (); - SnrTag (const SnrTag &o); - ~SnrTag (); - static uint32_t GetUid (void); - void Print (std::ostream &os) const; - uint32_t GetSerializedSize (void) const; - void Serialize (Buffer::Iterator i) const; - uint32_t Deserialize (Buffer::Iterator i); + + static TypeId GetTypeId (void); + virtual TypeId GetInstanceTypeId (void) const; + + virtual uint32_t GetSerializedSize (void) const; + virtual void Serialize (MtagBuffer i) const; + virtual void Deserialize (MtagBuffer i); void Set (double snr); double Get (void) const; @@ -55,40 +54,39 @@ double m_snr; }; -SnrTag::SnrTag () - : m_snr (0.0) -{} -SnrTag::SnrTag (const SnrTag &o) - : m_snr (o.m_snr) -{} -SnrTag::~SnrTag () -{} -uint32_t -SnrTag::GetUid (void) +TypeId +SnrTag::GetTypeId (void) { - static uint32_t uid = AllocateUid ("SnrTag.ns3.inria.fr"); - return uid; + static TypeId tid = TypeId ("ns3::SnrTag") + .SetParent () + .AddConstructor () + .AddAttribute ("Snr", "The snr of the last packet received", + DoubleValue (0.0), + MakeDoubleAccessor (&SnrTag::Get), + MakeDoubleChecker ()) + ; + return tid; } -void -SnrTag::Print (std::ostream &os) const +TypeId +SnrTag::GetInstanceTypeId (void) const { - os << "snr="<