<div dir="ltr">Hi Fabio<div><br></div><div>Although I haven't implemented any CS replacement policy, I participated in the design of nfd::cs::Policy class.</div><div><br></div><div>Policy::doAfterInsert method is invoked when a CS entry is <u>already</u> inserted. The latest inserted entry is given in the interator.</div><div>The iterator type is declared in cs-internal.hpp. When you dereference the iterator with <font face="monospace, monospace">*i</font>, you'll get a nfd::cs::Entry object.</div><div>Entry object is declared in cs-entry.hpp. You can access the Data packet from the entry.</div><div>If your policy decides that the latest inserted entry should not be admitted, the policy can evict this entry immediately.</div><div><br></div><div>To get access to other entries previously inserted to the CS, the policy needs to maintain a data structure that keeps the iterators (not the EntryImpl objects).</div><div>You may find examples in existing policy implementations, for example LruPolicy class m_queue member.</div><div><br></div><div>To associate additional information with an Entry, a policy implementation can declare a struct that associates the iterator and additional information, and then place this struct in the policy's internal data structure. nfd::cs::Entry and nfd::cs::EntryImpl classes should not be modified.</div><div>An example is nfd::cs::priority_fifo::EntryInfo type, and PriorityFifoPolicy::m_entryInfoMap member.</div><div><br></div><div>Yours, Junxiao<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 5, 2016 at 6:07 PM, Fabio Campioni <span dir="ltr"><<a href="mailto:fcampioni@algomau.ca" target="_blank">fcampioni@algomau.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">





<div lang="EN-CA" link="blue" vlink="#954F72">
<div>
<p class="MsoNormal">Hi all,</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I have recently switched from using the old content store to the new NFD API for creating a cache replacement policy. However, in the methods, specifically doAfterInsert, where an iterator object is passed to it, I am not sure what methods
 are available in that object or how to actually access the data and cannot find anything in the NFD documentation. Would anyone who has worked with the NFD content store be able to point me in the right direction?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thank you,<span class=""><font color="#888888"><u></u><u></u></font></span></p><span class=""><font color="#888888">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Fabio Campioni<u></u><u></u></p>
</font></span></div>
</div>

<br>_______________________________________________<br>
ndnSIM mailing list<br>
<a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>
<a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" rel="noreferrer" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>
<br></blockquote></div><br></div></div></div>