[ndnSIM] printing the content of PIT table

Spyridon (Spyros) Mastorakis mastorakis at cs.ucla.edu
Thu Jul 6 17:47:14 PDT 2017


Hi,

the API of the NFD PIT class provides begin and end iterators:

https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.5.0-30-g934f505-ndnSIM/daemon/table/pit.hpp#L100-L118

You can use those iterators to access individual PIT entries and use the getName method of each entry to get its name:

https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.5.0-30-g934f505-ndnSIM/daemon/table/pit-entry.hpp#L74-L80

Finally, you can use the toUri method of the Name class to convert the name of an entry to an std::string:

https://github.com/named-data-ndnSIM/ndn-cxx/blob/ndn-cxx-0.5.0-17-g99832d4-ndnSIM/src/name.hpp#L253-L254

Hope that this helps,

Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
Internet Research Laboratory
Computer Science Department
UCLA

> On Jul 5, 2017, at 11:19 PM, madhurima.2015 at iitg.ernet.in wrote:
> 
> Hi everyone,
> 
> could you please help me in printing out the contents of PIT??
> If we  write nfd::pit::Entry pitentry;
> it shows errors

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


More information about the ndnSIM mailing list