[ndnSIM] How to create pointer to a customized App

Monika Dangi monikabaraut at gmail.com
Fri Apr 29 09:16:17 PDT 2016

I got it..
I used Dynamic cast and it worked fine

On Thu, Apr 28, 2016 at 4:54 PM, Monika Dangi <monikabaraut at gmail.com>

> Hello,
> I wrote my own producer App, MyApp. then i installed it on a node like:
>  ndn::AppHelper appHelper ("MyApp");
>   ApplicationContainer app = appHelper.Install (mobileNodes);
> now i want to use pointer to this app and the object of this MyApp.
> i used method
> Ptr<Application> ap_ptr =app.Get(0);
> but when i use the pointer like
> ap_ptr->myfunction();
> there is an error that Application has no function called myfunction.
> i derived MyApp from Application and added ane more function myfunction.
> now i want to pass the pointer of MyApp so that i can use myfunction in
> other function.
> but all i can get the pointer to Application which doesnt have myfunction.
> what should i do?
> Also how to get object of MyApp Application. or do i have to now access
> this application via node only??
> can anybody guide me?? just a little hint.
> --
> Monika
> MTech CSE
> IIT Roorkee

IIT Roorkee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20160429/0f700883/attachment.html>

More information about the ndnSIM mailing list