[ndnSIM] declaring a variable in ndn-forwarding-strategy

Alex Afanasyev alexander.afanasyev at ucla.edu
Mon Dec 16 11:47:44 PST 2013


Hi Isuru,

Are you running simulation in the visualizer?  Try to run without it and in debug mode (in case you have compiled with ./waf configure -d optimized, re-compile with ./waf configure -d debug or just ./waf configure).

The variable declaration seems right.  The problem that I could think of is that you're trying to use it in application's constructor, when neither Node() nor strategy objects are not yet set.

Btw. What the effect you're trying to achieve?  Normally (in "real world") applications cannot directly communicate with the forwarding daemon.  Or is it something that is simulation-specific?

---
Alex

On Dec 16, 2013, at 11:43 AM, <i.liyanage at surrey.ac.uk> <i.liyanage at surrey.ac.uk> wrote:

> Hi Alex,
> 
> It terminates without anything once I click the simulate button. 
> I will try with the debugger as well.
> 
> Could you suggest me a way to declare this kind of variable which could be accessed in both forwadingStrategy class and in an application.
> 
> Many Thanks,
> Isuru
> From: Alexander Afanasyev <cawka1 at gmail.com> on behalf of Alex Afanasyev <alexander.afanasyev at ucla.edu>
> Sent: 16 December 2013 19:26
> To: Liyanage IU Mr (PG/R - Electronic Eng)
> Cc: ndnsim
> Subject: Re: [ndnSIM] declaring a variable in ndn-forwarding-strategy
>  
> Is it just terminates without any output or terminates with an error?
> 
> If it is an error, then try to run in a debugger, so you can see what exactly is causing the error.  For example,
> 
> ./waf --run <scenario> --command-template 'gdb --args %s'
> 
> ---
> Alex
> 
> On Dec 15, 2013, at 10:17 AM, <i.liyanage at surrey.ac.uk> <i.liyanage at surrey.ac.uk> wrote:
> 
>> Hi,
>> 
>> In ndn-forwading-strategy.h, I declared variable.
>> std::set<Name>  m_allowCS;
>> 
>> and tried to access in one of the applications by following code
>> Ptr<ForwardingStrategy> forwardingstat = GetNode()->GetObject<ForwardingStrategy>();
>> Ptr<Name> inName = Create<ndn::Name> ("/prefix");
>> forwardingstat->m_allowCS.insert(*inName);
>> 
>> This compiles fine.
>> but once I run this, simulator exit without any output. Could you point out what's wrong.
>> 
>> Many Thanks,
>> Isuru
>> _______________________________________________
>> ndnSIM mailing list
>> ndnSIM at lists.cs.ucla.edu
>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
> 
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20131216/236a6759/attachment.html>


More information about the ndnSIM mailing list