[ndnSIM] Conversion from ns3::Application to specific application type.

Anil Jangam anilj.mailing at gmail.com
Sat Dec 19 14:43:44 PST 2015


Hi,

In a scenario where an application instance is installed on the nodes, what
is the way to retrieve that application instance from the node?

In my requirement, I want to set some parameters into my application
object, which is not possible at the time it is installed on the node.
Perhaps they all do not use the parametrized constructor (I am talking
about the classes in ns-3/src/ndnSIM/apps path).

In an example below:
 80   ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
 83   consumerHelper.Install(consumerNodes);

I want to retrieve back the instance of "ns3::ndn::ConsumerCbr" from the
consumerNodes object.

I checked the API in bit details, the ndn-app-helper has this code:
119   Ptr<Application> app = m_factory.Create<Application>();
120   node->AddApplication(app);

The node interface also provides an API GetApplication, but it returns
Application instance:
160 Ptr<Application>
161 Node::GetApplication (uint32_t index) const

How to convert it from ns3::Application to ns3::ndn::ConsumerCbr? Perhaps
this is simple type casting operation, but just want to confirm it.

Any other suggestion to achieve the same (i.e. updating the application
instance installed on the node) is also fine with me.

/anil.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20151219/51510a1f/attachment.html>


More information about the ndnSIM mailing list