[ndnSIM] Delete a pitEntry (not so easy as it seems to be)
Natalya Rozhnova
rozhnova.natalya at gmail.com
Fri Dec 11 06:07:32 PST 2015
Hi Alex, Junxiao,
Thank you very much for your replies. Indeed, Alex's solution seems to be
much faster than re-insert a pit entry.
Anyway, thanks to you two for the support!
Best,
Natalya
2015-12-11 0:45 GMT+01:00 Alex Afanasyev <aa at cs.ucla.edu>:
> Hi Natalya,
>
> This seem to be a deficiency in the current interface that we should fix
> asap.
>
> As an immediate workaround, which could be faster then what Junxiao
> suggested, but not future-safe code:
>
> auto pitIterator = pit.begin();
> // ...
> shared_ptr<pit::Entry> pitEntry = pitIterator.operator->();
> pit.erase(pitEntry);
>
> ---
> Alex
>
> On Dec 10, 2015, at 8:40 AM, Junxiao Shi <shijunxiao at email.arizona.EDU
> <shijunxiao at email.arizona.edu>> wrote:
>
> Hi Natalya
>
> You may invoke Pit::insert again with the same Interest, which would
> return the same entry as a shared_ptr<pit::Entry>.
> Then you can erase this entry.
>
> Yours, Junxiao
>
> On Thu, Dec 10, 2015 at 4:02 AM, Natalya Rozhnova <
> rozhnova.natalya at gmail.com> wrote:
>
>> Hi all,
>>
>> It's me again. :)
>> The task I want to perform is to iterate in the Pit in order to find some
>> interesting entries and delete them.
>> I just discovered that the Pit iterators return const nfd::pit::Entry&
>> but the function erase takes shared_ptr<pit::Entry> as parameter. I can't
>> create the shared_ptr with make_shared because the class is protected by
>> "noncopyable". So I can't delete the entries I want by iterating in the
>> pit...
>> Is there any other way to do it?
>>
>> Thanks in advance.
>> Best,
>> Natalya
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20151211/a7d324d2/attachment.html>
More information about the ndnSIM
mailing list