[ndnSIM] How can I print the InRecords out?

Spyridon (Spyros) Mastorakis mastorakis at CS.UCLA.EDU
Thu Nov 10 10:58:10 PST 2016


1) an inRecord is a class that has some certain methods and attributes. Please take a look here to see how you can get the attributes that you want:

https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/pit-in-record.hpp <https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/pit-in-record.hpp>
https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/pit-in-record.cpp <https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/pit-in-record.cpp>

2) You have to iterate through the entries of the PIT. A PIT has multiple entries and you need to move the iterator forward to point to the next entry.

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

> On Nov 8, 2016, at 6:21 AM, RuntongChen <runtongchen at csu.edu.cn> wrote:
> Hi Spyridon,
> Thanks for your answer very much.With the help of "const nfd::Pit::const_iterator iterator = pit.begin();",I can print the Name out.And the code is "std::cout << (*iterator).getName()<<"\n";".But I meet two questions now.The first one is why I can't use "std::cout << (*iterator).getInRecords()<<"\n";" to print InRecords out?And the error is"cannot bind 'std::ostream {aka std::basic_ostream<char>}' Lvalue to 'std::basic_ostream<char>&&'".If I can't do like this.What should I do?The second one is that I find there has no member of 'next' in 'nfd::Pit'.So if I want to iterator the pit::entry,what should I do to let the iterator goes to the next?
> I am thankful for your guidance and support.
> sincerely,
> Runtong

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

More information about the ndnSIM mailing list