[ndnSIM] question about faceIterator in CustomStrategy

Alex Afanasyev alexander.afanasyev at ucla.edu
Sat Mar 30 14:14:43 PDT 2013

Hi huyao,

The data structure that stores ordered Face instances in FIB behaves like any other STL container:
begin ()  returns iterator to first element in the container
end () returns a special iterator, indicating element just after the last valid element

In other words, end () is never an iterator to a valid element in the container, and situations when begin () == end () means that the container has no elements.  If there is at least one element in the container, begin () will return iterator to a valid first element.


On Mar 30, 2013, at 8:20 AM, yao hu <huyao0107 at gmail.com> wrote:

> Hi Alex,
> Thanks for your reply to the previous question about ndnsim update.
> Now I am looking into the CustomStrategy::DoPropagateInterest. This function is to let Interest be forwarded to first two best-metric faces specified by FIB. However, in the codes, the faceIterator is first pointed to the beginning of faces ordered by metric and then checked whether it is pointed to the end of the faces. Assume that there is only one face existing in the associated faces for the fib entry. For my understanding, this face is located at the beginning of the faces and also should be located at the end of the faces. Then according to the DoPropagateInterest algorithm, the incoming interest will be not sent out though the fact is not like that for sure. So what is wrong with my understanding for the faceIterator? Or what is the internal structure of FacesByMetric &faces especially faces.begin () or faces.end()?
> I am sorry for my confusing expression. Thank you very much!
> Regards,
> huyao
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20130330/38c285fb/attachment.html>

More information about the ndnSIM mailing list