[ndnSIM] How to get an iterator to a content in policy_containter given a name
sarantarnoi at gmail.com
Tue Nov 17 23:37:48 PST 2015
I am working inside lru-policy.hpp and really need some ideas for code
My goal is to get an iterator of a policy_container that points to a
content which matches a given content name (ndn::Name).
I have achieved this goal through the following inline function.
inline typename policy_container::iterator
typename policy_container::iterator it;
for (it = policy_container::begin (); it != policy_container::end (); ++it)
if (name_item == it->payload()->GetName()) break;
However, the above code is so slow when policy_container is large (, which
makes sense as we will be iterating the check for all items in
policy_container in the worst case).
Is there any faster way to do this?
Your suggestion will be highly appreciated and I would like to thank you in
advance for your time.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ndnSIM