hi, Alex<br/>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<br/><div></div><DIV style="COLOR: #000"><DIV style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; FONT-FAMILY: Arial Narrow">------------------ 原始邮件 ------------------</DIV><DIV style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><DIV><B>发件人:</B> "alexander.afanasyev"<alexander.afanasyev@ucla.edu><wbr/></DIV><DIV><B>发送时间:</B> 2013年5月10日(星期五) 上午7:42</DIV><DIV><B>收件人:</B> "aaronishere"<aaronishere@qq.com>;</DIV><DIV><B>抄送:</B> "ndnsim@lists.cs.ucla.edu"<ndnsim@lists.cs.ucla.edu>;</DIV><DIV><B>主题:</B> Re: Question</DIV></DIV></DIV><html><div>Hi Aaron,</div><div><br  /></div>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.<div><br  /></div><div>To iterate over all elements of PIT you can do the following:</div><div><br  /></div><div>Ptr<ndn::Pit> pit = ?;</div><div>for (Ptr<pit::Entry> entry = pit->Begin (); entry != pit->End (); entry = pit->Next (entry))</div><div>{</div><div>...</div><div>}</div><div><br  /></div><div>---</div><div>Alex<br  /><div><br  /><div><div>On May 9, 2013, at 4:35 PM, aaronishere <<a href="mailto:aaronishere@qq.com">aaronishere@qq.com</a>> wrote:</div><br class="Apple-interchange-newline"  /><blockquote type="cite"><div style="line-height: 1.5; font-family: 微软雅黑; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; margin: 10px; "><div>Hi, Alex</div><div> </div><div> 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?</div><div> </div><div>Another is how to  loop of all pit-entry, such as</div><div>for ( pitentry::begin, pitentry::end, Next( ) )</div><div>{</div><div>......</div><div>},</div><div>I'm not clear abou it.</div><div> </div><div>Thanks!!</div><div> </div><hr align="left" size="1" style="width: 210px; height: 1px; "  /><div><span>Aaron</span></div></div></blockquote></div><br  /></div></div></html>