<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hi Teng,</div><div><br></div><div>I'm a little bit confused do you need specifically to traverse the specific policy container from strategy or you just need to iterate items within the specific policy?</div><div><br></div><div>If within the strategy, there probably no general way to do policy-specific traversal, but you can just traverse all items in content store using ContentStore's iterators:</div><div><br></div><div>Ptr<ContentStore> cs = this->GetObject<ContentStore>();</div><div>for (Ptr<cs::Entry> i = cs->Begin(); i != cs->End(); i = cs->Next(i))</div><div>{</div><div>   ...</div><div>}</div><div><br></div><div>If it is within the policy, then boost::intrusive::multiset has standard STL interface to do the traversal:</div><div><br></div><div>for (typename policy_container::iterator i = this->begin(); i != this->end(); i++)</div><div>{</div><div>   Ptr<cs::Entry> entry = i->payload();</div><div>   ...</div><div>}</div><div><br></div><div><br></div><div>I also not sure what do you mean by "a tag of data". Are you referring to NS-3's packet tags?  Unfortunately, as they are implemented right now, there is very little space available for each tag, and you need to implemented Serialize/Deserialize methods.</div><div><br></div><div>---</div><div>Alex</div><br><div><div>On Feb 12, 2014, at 5:14 AM, Teng <<a href="mailto:tengmingnianzbb@163.com">tengmingnianzbb@163.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="line-height: 1.7; font-size: 14px; font-family: arial;"><p>Hi Alex,</p><p>I am a new to ndnsim, now I wanna traverse CS ,and I think it is to traverse the vector in a replacement policy.Just as in lfu policy, how can I traverse the policy_container  (typedef boost::intrusive::multiset< Container,boost::intrusive::compare< MemberHookLess< Container > >,Hook > policy_container)?</p><p>And I wonder how to add a vector into a tag of data? For example,I would like  to make a vector to record m_hopCount,if a node cached data,it will add the current m_hopCount into the vector, so every node will know the distances from upstream nodes caching the data according to the vector in tag of data.</p><p>Would you please give me some hint?</p><p>Best Regards!</p><p><br></p><p><br></p></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span></blockquote></div><br></body></html>