[ndnSIM] How can I get ino "nfd::pit::Entry"

John Baugh jpbaugh at umich.edu
Sun Nov 13 21:43:54 PST 2016


Runtong,

I'm new to ndnSIM also, and Spyridon or one of the other more experienced
members can correct me if I'm wrong, but in a sample I was working on, this
is how I got information from the *content store*, and I suspect it's
*similar* to the *PIT*:

Given a Content Store initialized thusly:
* //get the content store for the node     *
*     nfd::Cs& myContentStore = l3->getForwarder()->getCs();*

I iterate through the items:

* //use iterators to move through the content store*
*     for(auto it = myContentStore.begin();*
*         it != myContentStore.end();*
*         ++it)*
*     { *
*        cout<<it->getName()<<endl; //it represents a shared_ptr*
*                           //to a single Data item*
*     } *


Hope this is useful to you and others.

John




On Sun, Nov 6, 2016 at 8:23 PM, Spyridon (Spyros) Mastorakis <
mastorakis at cs.ucla.edu> wrote:

> Hi,
>
> the PIT class does not have a getName method. An entry of PIT has a
> getName method. You can use the iterators to access the entries of PIT
> (or/and std::find if you want). When you actually get a PIT entry, you can
> apply the getName method to it (or the methods to get the InRecords and
> OutRecords).
>
> Hope that this helps,
>
> Spyridon (Spyros) Mastorakis
> Personal Website: http://cs.ucla.edu/~mastorakis/
> Internet Research Laboratory
> Computer Science Department
> UCLA
>
> On Nov 5, 2016, at 4:47 AM, RuntongChen <runtongchen at csu.edu.cn> wrote:
>
> Hello,
>
> Thanks very much for your quick and patient answer both of Spyridon and
> Junxiao.Based on your guidances,I can get the size of PIT already.But,What
> I really want is the Name,InRecords and OutRecords.And I find that they are
> in "nfd::pit::Entry" but not in "nfd::Pit".So,if I follow your advices and
> call the code of "pit.getName()".Then,The computer will give me the error
> :"const class nfd::Pit has no number named 'getName'".So,I'd like to know
> how can I get into "nfd::pit::Entry"and print the "Name" out?
>
> *Looking forward to your response.*
>
> *Yours,*
>
> *Runtong*
>
>
>
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20161114/a598ea4c/attachment.html>


More information about the ndnSIM mailing list