From 847f7587ff390c11d3493e8514c948587e243b22 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Tue, 26 Feb 2008 18:03:59 +0100 Subject: [PATCH] application and netdevice lists are attributes now. --- src/node/node.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/node/node.cc b/src/node/node.cc index 3085c5b23..03f601316 100644 --- a/src/node/node.cc +++ b/src/node/node.cc @@ -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 @@ TypeId Node::GetTypeId (void) { static TypeId tid = TypeId ("Node") - .SetParent (); + .SetParent () + .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 ()) + ; return tid; }