[ndnSIM] definition

Alex Afanasyev alexander.afanasyev at ucla.edu
Sun Feb 16 01:49:27 PST 2014


Hi nor,

This was done for the cases when one wants to do some optimizations.  The call that you referring as "argument by copy" is actually taking an argument by pointer (smart Ptr<Name> pointer).  In this case, only pointer will be copied inside the Interest/Data packet, not the whole memory block to hold the name.  The second SetName is a convenience, less optimized method.    After this version is called, a new Ptr<Name> will be created and supplied name will be copied in there.

---
Alex

On Jan 27, 2014, at 12:27 AM, nor masri sahri <masri.sahri at gmail.com> wrote:

> hi all, Why ndnsim have two versions of SetName(), one that takes its argument by copy and one that takes it by const reference? And why are these two actually defined differently?
> 
> -- 
> Regards,
> 
> masri.sahri

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


More information about the ndnSIM mailing list