From ad8424e6d102e04e5eeae864b4e9713965f35310 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Thu, 10 May 2007 07:44:18 +0200 Subject: [PATCH] convert Node * to Ptr --- src/internet-node/l3-demux.cc | 12 +++--------- src/internet-node/l3-demux.h | 5 +++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/internet-node/l3-demux.cc b/src/internet-node/l3-demux.cc index 5f261aca5..8f5ddc56f 100644 --- a/src/internet-node/l3-demux.cc +++ b/src/internet-node/l3-demux.cc @@ -31,12 +31,10 @@ namespace ns3 { const Iid L3Demux::iid ("L3Demux"); -L3Demux::L3Demux (Node *node) +L3Demux::L3Demux (Ptr node) : NsUnknown (L3Demux::iid), m_node (node) -{ - m_node->Ref (); -} +{} L3Demux::~L3Demux() {} @@ -50,11 +48,7 @@ L3Demux::DoDispose (void) i->second->Unref (); } m_protocols.clear (); - if (m_node != 0) - { - m_node->Unref (); - m_node = 0; - } + m_node = 0; NsUnknown::DoDispose (); } diff --git a/src/internet-node/l3-demux.h b/src/internet-node/l3-demux.h index 40f8318f5..9e3ffdc0a 100644 --- a/src/internet-node/l3-demux.h +++ b/src/internet-node/l3-demux.h @@ -29,6 +29,7 @@ #include #include "ns3/ns-unknown.h" +#include "ns3/ptr.h" namespace ns3 { @@ -45,7 +46,7 @@ class L3Demux : public NsUnknown public: static const Iid iid; typedef int ProtocolTraceType; - L3Demux(Node *node); + L3Demux(Ptr node); virtual ~L3Demux(); /** @@ -90,7 +91,7 @@ protected: private: typedef std::map L3Map_t; - Node *m_node; + Ptr m_node; L3Map_t m_protocols; };