[ndnSIM] How to get node id in lru-policy.hpp
Alex Afanasyev
aa at CS.UCLA.EDU
Mon Dec 28 09:01:51 PST 2015
Hi Saran,
The solution you found is getting access to nodeId from the ndnSIM 1.0 strategy. For the caching policy, you can do the following:
item->payload()->GetContentStore()->GetObject<Node>()->GetId()
You can also use the following (cheaty) solution that can work in most of the places:
Simulator::GetContext(); // context ID == nodeId
--
Alex
> On Dec 28, 2015, at 1:05 AM, Saran Tarnoi <sarantarnoi at gmail.com> wrote:
>
> Dear All,
>
> I would like to get node id (or the node name) while being in lru-policy.hpp for logging purpose.
> I am using ndnSIM-2.0. A solution found at http://www.lists.cs.ucla.edu/pipermail/ndnsim/2014-May/001307.html <http://www.lists.cs.ucla.edu/pipermail/ndnsim/2014-May/001307.html> did not work. I have no idea how I can get a pointer to Node from here.
>
> Could you give me some pieces of advice?
>
> Thanks a lot in advance for your help.
>
> --
> Best regards,
> Saran Tarnoi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20151228/62bbc31a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20151228/62bbc31a/attachment.bin>
More information about the ndnSIM
mailing list