<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" id="owaParaStyle" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
</head>
<body dir="ltr" tabindex="0" fpstyle="1" aria-label="Message body" id="">
<div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif; font-size: 12pt; color: #000000; margin: 0">
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
Hi Alex,</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<br>
</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
I tried writing the code in ndnSIM/apps folder and it worked fine.</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<br>
</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
But when I use the same code in scenario folder (used scenario template of yours) it fails as i mentioned. </p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<br>
</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
It must be something regarded to the scenario template.....</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
As if I include the file "ns3/ndn-forwarding-strategy.h" it says my variable(set container) is not defined, </p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<font color="#808080">../extensions/testsimple.cc:109:19: error: ‘class ns3::ndn::ForwardingStrategy’ has no member named ‘m_allowCS’</font></p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
so I have to include the complete path to the above header file. Then it compiles fine. but end abruptly. </p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<br>
</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<br>
</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
In the terminal I just want to confirm whether the program works by looking at the log messages.</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<br>
</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
I attached the following files which I modified.</p>
<p>../scenario/extensions/testsimple.h         -       modified from ndn-producer</p>
<p>../scenario/extensions/testsimple.cc</p>
<p>../scenario/scenarios/simple.cc               -       modified from ndn-simple</p>
<p><br>
</p>
<p>ndnSIM/model/fw/ndn-forwarding-strategy.h</p>
<p>ndnSIM/model/fw/ndn-forwarding-strategy.cc</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<br>
</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
Many Thanks,</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
Isuru</p>
<div style="color: rgb(40, 40, 40); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Alexander Afanasyev <cawka1@gmail.com> on behalf of Alex Afanasyev <alexander.afanasyev@ucla.edu><br>
<b>Sent:</b> 16 December 2013 21:30<br>
<b>To:</b> Liyanage IU Mr (PG/R - Electronic Eng)<br>
<b>Cc:</b> ndnsim<br>
<b>Subject:</b> Re: [ndnSIM] declaring a variable in ndn-forwarding-strategy</font>
<div> </div>
</div>
<div>
<div>Hi Isuru,</div>
<div><br>
</div>
<div>I have tried to follow your implementation (added set container in the forwarding strategy and the added a prefix in StartApplication).  Everything worked as expected.</div>
<div><br>
</div>
<div>If you can share your code, I can try to run it and see what is wrong.</div>
<div><br>
</div>
<div>Btw. What are you expecting to see on the terminal?</div>
<div><br>
</div>
<div>---s</div>
<div>Alex</div>
<br>
<div>
<div>On Dec 16, 2013, at 12:37 PM, <<a href="mailto:i.liyanage@surrey.ac.uk">i.liyanage@surrey.ac.uk</a>> <<a href="mailto:i.liyanage@surrey.ac.uk">i.liyanage@surrey.ac.uk</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div dir="ltr" tabindex="0" style="font-family:Menlo-Regular; font-size:14px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; margin:0px">
<div style="margin-top:0px; margin-bottom:0px">Hi Alex,</div>
<div style="margin-top:0px; margin-bottom:0px"><br>
</div>
<div style="margin-top:0px; margin-bottom:0px">I compiled without the -d optimized and ran without the visualizer. </div>
<div style="margin-top:0px; margin-bottom:0px">Then it just compile and nothing is displayed in the terminal.</div>
<div style="margin-top:0px; margin-bottom:0px"><br>
</div>
<div style="margin-top:0px; margin-bottom:0px">I entered the code in StartApplication() function.</div>
<div style="margin-top:0px; margin-bottom:0px"><br>
</div>
<div style="margin-top:0px; margin-bottom:0px">I was trying to build a collaborative caching application.</div>
<div style="margin-top:0px; margin-bottom:0px"><br>
</div>
<div style="margin-top:0px; margin-bottom:0px"><font color="#808080">Ptr<ForwardingStrategy> forwardingstat = GetNode()->GetObject<ForwardingStrategy>();</font></div>
<div style="margin-top:0px; margin-bottom:0px"><font color="#808080">Ptr<Name> inName = Create<ndn::Name> ("/prefix/thisfix/");</font></div>
<div style="margin-top:0px; margin-bottom:0px"><font color="#ff0000">forwardingstat->addAllowCS(inName);</font></div>
<div style="margin-top:0px; margin-bottom:0px"><font color="#ff0000"><br>
</font></div>
<div style="margin-top:0px; margin-bottom:0px">If I comment out the third line(line in red) it works fine.</div>
<div style="margin-top:0px; margin-bottom:0px"><br>
</div>
<div style="margin-top:0px; margin-bottom:0px">Many Thanks,</div>
<div style="margin-top:0px; margin-bottom:0px">Isuru</div>
<div style="color:rgb(40,40,40)">
<hr tabindex="-1" style="display:inline-block; width:747px">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b><span class="Apple-converted-space"> </span>Alexander Afanasyev <<a href="mailto:cawka1@gmail.com">cawka1@gmail.com</a>> on behalf of Alex Afanasyev <<a href="mailto:alexander.afanasyev@ucla.edu">alexander.afanasyev@ucla.edu</a>><br>
<b>Sent:</b><span class="Apple-converted-space"> </span>16 December 2013 19:47<br>
<b>To:</b><span class="Apple-converted-space"> </span>Liyanage IU Mr (PG/R - Electronic Eng)<br>
<b>Cc:</b><span class="Apple-converted-space"> </span>ndnsim<br>
<b>Subject:</b><span class="Apple-converted-space"> </span>Re: [ndnSIM] declaring a variable in ndn-forwarding-strategy</font>
<div> </div>
</div>
<div>
<div>Hi Isuru,</div>
<div><br>
</div>
<div>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).</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>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?</div>
<div><br>
</div>
<div>---</div>
<div>Alex</div>
<br>
<div>
<div>On Dec 16, 2013, at 11:43 AM, <<a href="mailto:i.liyanage@surrey.ac.uk">i.liyanage@surrey.ac.uk</a>> <<a href="mailto:i.liyanage@surrey.ac.uk">i.liyanage@surrey.ac.uk</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div dir="ltr" tabindex="0" style="font-family:Menlo-Regular; font-size:14px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; margin:0px">
<div style="margin-top:0px; margin-bottom:0px">Hi Alex,</div>
<div style="margin-top:0px; margin-bottom:0px"><br>
</div>
<div style="margin-top:0px; margin-bottom:0px">It terminates without anything once I click the simulate button. </div>
<div style="margin-top:0px; margin-bottom:0px">I will try with the debugger as well.</div>
<div style="margin-top:0px; margin-bottom:0px"><br>
</div>
<div style="margin-top:0px; margin-bottom:0px">Could you suggest me a way to declare this kind of variable which could be accessed in both forwadingStrategy class and in an application.</div>
<div style="margin-top:0px; margin-bottom:0px"><br>
</div>
<div style="margin-top:0px; margin-bottom:0px">Many Thanks,</div>
<div style="margin-top:0px; margin-bottom:0px">Isuru</div>
<div style="color:rgb(40,40,40)">
<hr tabindex="-1" style="display:inline-block; width:747px">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b><span class="Apple-converted-space"> </span>Alexander Afanasyev <<a href="mailto:cawka1@gmail.com">cawka1@gmail.com</a>> on behalf of Alex Afanasyev <<a href="mailto:alexander.afanasyev@ucla.edu" title="mailto:alexander.afanasyev@ucla.edu
Ctrl+click or tap to follow link">alexander.afanasyev@ucla.edu</a>><br>
<b>Sent:</b><span class="Apple-converted-space"> </span>16 December 2013 19:26<br>
<b>To:</b><span class="Apple-converted-space"> </span>Liyanage IU Mr (PG/R - Electronic Eng)<br>
<b>Cc:</b><span class="Apple-converted-space"> </span>ndnsim<br>
<b>Subject:</b><span class="Apple-converted-space"> </span>Re: [ndnSIM] declaring a variable in ndn-forwarding-strategy</font>
<div> </div>
</div>
<div>
<div>Is it just terminates without any output or terminates with an error?</div>
<div><br>
</div>
<div>If it is an error, then try to run in a debugger, so you can see what exactly is causing the error.  For example,</div>
<div><br>
</div>
<div>./waf --run <scenario> --command-template 'gdb --args %s'</div>
<div><br>
</div>
<div>---</div>
<div>Alex</div>
<br>
<div>
<div>On Dec 15, 2013, at 10:17 AM, <<a href="mailto:i.liyanage@surrey.ac.uk">i.liyanage@surrey.ac.uk</a>> <<a href="mailto:i.liyanage@surrey.ac.uk">i.liyanage@surrey.ac.uk</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div dir="ltr" tabindex="0" style="font-family:Menlo-Regular; font-size:14px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; margin:0px">
Hi,
<div><br>
</div>
<div>In ndn-forwading-strategy.h, I declared variable.</div>
<div><font color="#808080">std::set<Name>  m_allowCS;</font></div>
<div><br>
</div>
<div>and tried to access in one of the applications by following code</div>
<div>
<div><font color="#808080">Ptr<ForwardingStrategy> forwardingstat = GetNode()->GetObject<ForwardingStrategy>();</font></div>
<div><font color="#808080">Ptr<Name> inName = Create<ndn::Name> ("/prefix");</font></div>
<div><font color="#808080">forwardingstat->m_allowCS.insert(*inName);</font></div>
</div>
<div><br>
</div>
<div>This compiles fine.</div>
<div>but once I run this, simulator exit without any output. Could you point out what's wrong.</div>
<div><br>
</div>
<div>Many Thanks,</div>
<div>Isuru</div>
</div>
_______________________________________________<br>
ndnSIM mailing list<br>
<a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>
<a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
_______________________________________________<br>
ndnSIM mailing list<br>
<a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>
<a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a></div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</body>
</html>