give Attribute powers to ssid
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sun, 02 Mar 2008 01:53:06 +0100
changeset 2527 75df305d02d9
parent 2526 b9ec2ac7b21e
child 2528 a527ec47b756
give Attribute powers to ssid
src/devices/wifi/ssid.cc
src/devices/wifi/ssid.h
--- a/src/devices/wifi/ssid.cc	Sun Mar 02 01:18:07 2008 +0100
+++ b/src/devices/wifi/ssid.cc	Sun Mar 02 01:53:06 2008 +0100
@@ -136,6 +136,8 @@
   return i;
 }
 
+VALUE_HELPER_CPP (Ssid);
+
 std::ostream &
 operator << (std::ostream &os, const Ssid &ssid)
 {
@@ -143,5 +145,13 @@
   return os;
 }
 
+std::istream &operator >> (std::istream &is, Ssid &ssid)
+{
+  std::string str;
+  is >> str;
+  ssid = Ssid (str.c_str ());
+  return is;
+}
+
 
 } // namespace ns3
--- a/src/devices/wifi/ssid.h	Sun Mar 02 01:18:07 2008 +0100
+++ b/src/devices/wifi/ssid.h	Sun Mar 02 01:53:06 2008 +0100
@@ -22,6 +22,7 @@
 
 #include <stdint.h>
 #include "ns3/buffer.h"
+#include "ns3/attribute-helper.h"
 
 namespace ns3 {
 
@@ -43,12 +44,17 @@
   uint32_t GetSerializedSize (void) const;
   Buffer::Iterator Serialize (Buffer::Iterator i) const;
   Buffer::Iterator Deserialize (Buffer::Iterator i);
+
+  VALUE_HELPER_HEADER_1 (Ssid);
 private:
   uint8_t m_ssid[33];
   uint8_t m_length;
 };
 
 std::ostream &operator << (std::ostream &os, const Ssid &ssid);
+std::istream &operator >> (std::istream &is, Ssid &ssid);
+
+VALUE_HELPER_HEADER_2 (Ssid);
 
 } // namespace ns3