diff --git a/src/applications/application.cc b/src/applications/application.cc index 6c62fe5ba..2d4badcd6 100644 --- a/src/applications/application.cc +++ b/src/applications/application.cc @@ -61,10 +61,7 @@ Application::~Application() void Application::DoDispose (void) { - if (m_node != 0) - { - m_node = 0; - } + m_node = 0; if (m_start) { Simulator::Cancel(m_startEvent); @@ -137,16 +134,8 @@ void Application::Stop(const RandomVariable& stopVar) m_stopVar = stopVar.Copy(); ScheduleStop(); } - -// \brief Assign this application to a given node -// Called by the application manager capability when adding -// an application to a node. -void Application::SetNode(Ptr n) -{ - m_node = n; -} -Ptr Application::PeekNode() const +Ptr Application::GetNode() const { return m_node; } diff --git a/src/applications/application.h b/src/applications/application.h index a85bfbf40..83c16a31f 100644 --- a/src/applications/application.h +++ b/src/applications/application.h @@ -102,10 +102,8 @@ void Start(const RandomVariable&); // \brief Attaches an application to a specific node // Specifies which node object this application is associated with. // \param Node object to associate with this application. - void SetNode(Ptr); - // \brief Returns the pointer to the attached node. - Ptr PeekNode() const; + Ptr GetNode() const; // Members Ptr m_node; // All applications have an associated node diff --git a/src/applications/onoff-application.cc b/src/applications/onoff-application.cc index ac74ef13e..6c6e6f847 100644 --- a/src/applications/onoff-application.cc +++ b/src/applications/onoff-application.cc @@ -170,7 +170,7 @@ void OnOffApplication::StartApplication() // Called at time specified by Star this)); #endif - IUdp *udp = PeekNode ()->QueryInterface (IUdp::iid); + IUdp *udp = GetNode ()->QueryInterface (IUdp::iid); m_socket = udp->CreateSocket (); udp->Unref (); m_socket->Connect (m_peerIP, m_peerPort);