<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi nor,<div><br></div><div>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.</div><div><br></div><div>---</div><div>Alex</div><div><br><div><div>On Jan 27, 2014, at 12:27 AM, nor masri sahri <<a href="mailto:masri.sahri@gmail.com">masri.sahri@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><span style="color:rgb(68,68,68);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:13px;line-height:17px;background-color:rgb(250,250,250)">hi all, Why ndnsim have two versions of </span><code style="margin:0px;padding:1px 5px;border:0px;font-size:13px;vertical-align:baseline;background-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;color:rgb(68,68,68);line-height:17px">SetName()</code><span style="color:rgb(68,68,68);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size:13px;line-height:17px;background-color:rgb(250,250,250)">, one that takes its argument by copy and one that takes it by const reference? And why are these two actually defined differently?</span><br clear="all">
<div><br></div>-- <br><div dir="ltr">Regards,<div><br></div><div>masri.sahri</div></div></div></blockquote></div><br></div></body></html>