<div dir="ltr">Hi Alex,<div><br></div><div>Thanks a lot for your help. However, I cannot get the first solution to work.</div><div>I got this log:</div><div><div>../src/ndnSIM/model/cs/../../utils/trie/lru-policy.hpp:81:72: error: ‘Node’ was not declared in this scope</div><div>../src/ndnSIM/model/cs/../../utils/trie/lru-policy.hpp:81:78: error: expected primary-expression before ‘)’ token</div></div><div><br></div><div>After including "ns3/node.h", I still got the following errors:</div><div><div>../src/ndnSIM/model/cs/../../utils/trie/lru-policy.hpp:82:76: error: expected primary-expression before ‘>’ token</div><div>../src/ndnSIM/model/cs/../../utils/trie/lru-policy.hpp:82:78: error: expected primary-expression before ‘)’ token</div></div><div><br></div><div>I do not know why GetObject<Node>() failed here. Using GetObject<ns3::Node>() did not help either. The compiler did not get it.</div><div>Did I miss something?</div><div><br></div><div>The second solution (Simulator::GetContext()) works well.</div><div><br></div><div>Regards,</div><div>Saran Tarnoi</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-29 2:01 GMT+09:00 Alex Afanasyev <span dir="ltr"><<a href="mailto:aa@cs.ucla.edu" target="_blank">aa@cs.ucla.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi Saran,</div><div><br></div><div>The solution you found is getting access to nodeId from the ndnSIM 1.0 strategy.  For the caching policy, you can do the following:</div><div><br></div><div>   item->payload()->GetContentStore()->GetObject<Node>()->GetId()</div><div><br></div><div>You can also use the following (cheaty) solution that can work in most of the places:</div><div><br></div><div>   Simulator::GetContext();  // context ID == nodeId</div><div><br></div><div>--</div><div>Alex</div><div><div class="h5"><br><div><blockquote type="cite"><div>On Dec 28, 2015, at 1:05 AM, Saran Tarnoi <<a href="mailto:sarantarnoi@gmail.com" target="_blank">sarantarnoi@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Dear All,<div><br></div><div>I would like to get node id (or the node name) while being in lru-policy.hpp for logging purpose.</div><div>I am using ndnSIM-2.0. A solution found at <a href="http://www.lists.cs.ucla.edu/pipermail/ndnsim/2014-May/001307.html" target="_blank">http://www.lists.cs.ucla.edu/pipermail/ndnsim/2014-May/001307.html</a> did not work. I have no idea how I can get a pointer to Node from here.</div><div><br></div><div>Could you give me some pieces of advice?<br></div><div><br></div><div>Thanks a lot in advance for your help.<br clear="all"><div><br></div>-- <br><div><div dir="ltr">Best regards,<div>Saran Tarnoi</div></div></div></div></div></div></blockquote></div></div></div></div></blockquote></div>
</div></div>