[ndnSIM] 回复: Question

Aaron aaronishere at qq.com
Thu May 9 18:02:21 PDT 2013


hi, Alex
since the insert function always erase the item in the beginning. if it's possible to delete the first several items something like when A comes, erases the beginning, then B comes,erases the second,C erases the third. Say we only replace the first five item, then when F comes, re-erases the beginning

------------------ 原始邮件 ------------------
发件人: "alexander.afanasyev"<alexander.afanasyev at ucla.edu>
发送时间: 2013年5月10日(星期五) 上午7:42
收件人: "aaronishere"<aaronishere at qq.com>;
抄送: "ndnsim at lists.cs.ucla.edu"<ndnsim at lists.cs.ucla.edu>;
主题: Re: Question


Hi Aaron,


It is almost impossible to get a position number of an item, since the PIT data structure is a recursive hash-based container.  Is there any specific use case why you want to get this number?  If you really need such functionality, the custom PIT policy can track PIT item positions.

To iterate over all elements of PIT you can do the following:


Ptr<ndn::Pit> pit = ?;
for (Ptr<pit::Entry> entry = pit->Begin (); entry != pit->End (); entry = pit->Next (entry))
{
...
}


---
Alex

On May 9, 2013, at 4:35 PM, aaronishere <aaronishere at qq.com> wrote:

Hi, Alex
 
 Is there some way to get the position number of item in the *-policy.h,  such as the lookuped item is the 5th item in the container?
 
Another is how to  loop of all pit-entry, such as
for ( pitentry::begin, pitentry::end, Next( ) )
{
......
},
I'm not clear abou it.
 
Thanks!!
 

Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20130510/74d4d737/attachment.html>


More information about the ndnSIM mailing list