NetDevice and Channel now derive from Interface rather than Object
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Fri, 11 May 2007 19:26:01 +0200
changeset 582 b10ef84683a5
parent 581 15240a33f517
child 583 bf6fe8b3c54a
NetDevice and Channel now derive from Interface rather than Object
src/node/channel.cc
src/node/channel.h
src/node/net-device.cc
src/node/net-device.h
--- a/src/node/channel.cc	Fri May 11 19:15:28 2007 +0200
+++ b/src/node/channel.cc	Fri May 11 19:26:01 2007 +0200
@@ -27,14 +27,18 @@
 
 namespace ns3 {
 
+const InterfaceId Channel::iid ("Channel");
+
 Channel::Channel ()
-  : m_name("Channel")
+  : Interface (Channel::iid),
+    m_name("Channel")
 {
   NS_DEBUG("Channel::Channel ()");
 }
 
 Channel::Channel (std::string name)
-  : m_name(name)
+  : Interface (Channel::iid),
+    m_name(name)
 {
   NS_DEBUG("Channel::Channel (" << name << ")");
 }
--- a/src/node/channel.h	Fri May 11 19:15:28 2007 +0200
+++ b/src/node/channel.h	Fri May 11 19:26:01 2007 +0200
@@ -24,7 +24,7 @@
 
 #include <string>
 #include <stdint.h>
-#include "ns3/object.h"
+#include "ns3/interface.h"
 #include "ns3/ptr.h"
 
 namespace ns3 {
@@ -37,9 +37,10 @@
  * A channel is a logical path over which information flows.  The path can
  * be as simple as a short piece of wire, or as complicated as space-time.
  */
-class Channel : public Object
+class Channel : public Interface
 {
 public:
+  static const InterfaceId iid;
   Channel ();
   Channel (std::string name);
 
--- a/src/node/net-device.cc	Fri May 11 19:15:28 2007 +0200
+++ b/src/node/net-device.cc	Fri May 11 19:26:01 2007 +0200
@@ -21,15 +21,19 @@
 
 #include <iostream>
 #include "ns3/assert.h"
+#include "ns3/interface.h"
 
+#include "channel.h"
 #include "net-device.h"
 #include "llc-snap-header.h"
 #include "node.h"
-#include "ns3/channel.h"
 
 namespace ns3 {
 
+const InterfaceId NetDevice::iid ("NetDevice");
+
 NetDevice::NetDevice(Ptr<Node> node, const MacAddress& addr) : 
+  Interface (NetDevice::iid),
   m_node (node), 
   m_name(""), 
   m_ifIndex (0), 
--- a/src/node/net-device.h	Fri May 11 19:15:28 2007 +0200
+++ b/src/node/net-device.h	Fri May 11 19:26:01 2007 +0200
@@ -25,9 +25,9 @@
 #include <stdint.h>
 #include "ns3/callback.h"
 #include "ns3/packet.h"
-#include "ns3/object.h"
+#include "ns3/interface.h"
+#include "ns3/ptr.h"
 #include "mac-address.h"
-#include "ns3/ptr.h"
 
 namespace ns3 {
 
@@ -55,9 +55,10 @@
  * this base class and implement your own version of the
  * NetDevice::SendTo method.
  */
-class NetDevice : public Object 
+class NetDevice : public Interface
 {
 public:
+  static const InterfaceId iid;
   /**
    * \param node base class node pointer of device's node 
    * \param addr MAC address of this device.