Why the "apps = client.Install (n.Get (0))" in udp-client-server-test.cc?

29 views
Skip to first unread message

vehiNs

unread,
May 19, 2017, 5:19:28 AM5/19/17
to ns-3-users
In udp-client-server-helper.cc, the function is "ApplicationContainer UdpClientHelper::Install (NodeContainer c)".
But in udp-client-server-test.cc,  Why the parameter is "Ptr<Node>" in "apps = client.Install (n.Get (0))"?
Can you help me solve this problem? 
Thank you.
udp-client-server-helper.cc
udp-client-server-helper.h
udp-client-server-test.cc

Rediet

unread,
May 19, 2017, 5:59:14 AM5/19/17
to ns-3-users
Hello,
It's because there is an implicit type conversion from Ptr<Node> to NodeContainer, using the constructor NodeContainer::NodeContainer (Ptr<Node>), before entering into the Install method. You can see it happen by performing step by step debug in Eclipse.
Rediet

vehiNs

unread,
May 19, 2017, 8:37:32 AM5/19/17
to ns-3-users
I understand this. Thank you very much.
Reply all
Reply to author
Forward
0 new messages