implement properly Application::DoDispose and rename Application::PeekNOde to Application::GetNode
parent
f5451f5bce
commit
60734cd2db
|
@ -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<Node> n)
|
||||
{
|
||||
m_node = n;
|
||||
}
|
||||
|
||||
Ptr<Node> Application::PeekNode() const
|
||||
Ptr<Node> Application::GetNode() const
|
||||
{
|
||||
return m_node;
|
||||
}
|
||||
|
|
|
@ -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<Node>);
|
||||
|
||||
// \brief Returns the pointer to the attached node.
|
||||
Ptr<Node> PeekNode() const;
|
||||
Ptr<Node> GetNode() const;
|
||||
|
||||
// Members
|
||||
Ptr<Node> m_node; // All applications have an associated node
|
||||
|
|
|
@ -170,7 +170,7 @@ void OnOffApplication::StartApplication() // Called at time specified by Star
|
|||
this));
|
||||
#endif
|
||||
|
||||
IUdp *udp = PeekNode ()->QueryInterface<IUdp> (IUdp::iid);
|
||||
IUdp *udp = GetNode ()->QueryInterface<IUdp> (IUdp::iid);
|
||||
m_socket = udp->CreateSocket ();
|
||||
udp->Unref ();
|
||||
m_socket->Connect (m_peerIP, m_peerPort);
|
||||
|
|
Loading…
Reference in New Issue