application and netdevice lists are attributes now.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue, 26 Feb 2008 18:03:59 +0100
changeset 2478 8ace2f58506e
parent 2477 64ab84674302
child 2479 7d1d80aea47b
application and netdevice lists are attributes now.
src/node/node.cc
--- a/src/node/node.cc	Tue Feb 26 18:03:44 2008 +0100
+++ b/src/node/node.cc	Tue Feb 26 18:03:59 2008 +0100
@@ -26,6 +26,8 @@
 #include "ns3/packet.h"
 #include "ns3/simulator.h"
 #include "ns3/composite-trace-resolver.h"
+#include "ns3/object-vector.h"
+#include "ns3/uinteger.h"
 
 namespace ns3{
 
@@ -35,7 +37,21 @@
 Node::GetTypeId (void)
 {
   static TypeId tid = TypeId ("Node")
-    .SetParent<Object> ();
+    .SetParent<Object> ()
+    .AddAttribute ("DeviceList", "The list of devices associated to this Node.",
+                   ObjectVector (),
+                   MakeObjectVectorAccessor (&Node::m_devices),
+                   MakeObjectVectorChecker ())
+    .AddAttribute ("ApplicationList", "The list of applications associated to this Node.",
+                   ObjectVector (),
+                   MakeObjectVectorAccessor (&Node::m_applications),
+                   MakeObjectVectorChecker ())
+    .AddAttribute ("Id", "The id (unique integer) of this Node.",
+                   TypeId::ATTR_GET, // allow only getting it.
+                   Uinteger (0),
+                   MakeUintegerAccessor (&Node::m_id),
+                   MakeUintegerChecker<uint32_t> ())
+    ;
   return tid;
 }