[ndnSIM] Ways to create new Interest object

Spyridon (Spyros) Mastorakis mastorakis at cs.ucla.edu
Tue Apr 3 12:14:34 PDT 2018

Hi Mudasir,

you are saying that the findOrInsert method gives you an error, but you are not saying what the error is.

Another thing you might have to do with solution #2 is to generate a new nonce for the Interest.


Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
Internet Research Laboratory
Computer Science Department

> On Apr 3, 2018, at 8:20 AM, Mudasir Qazi <mudasirqazi00 at gmail.com> wrote:
> Hi,
> My requirement:
> I need to create new Interest from an existing Interest so that all properties will be copied to newly created Interest, than I need to set its name using setName method. I know following two ways to do this:
> Method #1: Creating empty Interest and setting name like this:
> const Name& tempName = "---";
> shared_ptr<Interest> tempInterest = make_shared<Interest>();
> tempInterest->setName(tempName);
> This method does not copy other properties, but only creates empty Interest and sets its name. And it works fine.
> Method #2: Creating Interest from an existing Interest like this:
> const Name& tempName = "---";
> Interest tempInterest = Interest(interest.wireEncode());
> tempInterest.setName(tempName);
> My problem:
> Now, I know Method#2 is the official way that meets my requirements. But the thing is, when I use method#2 it gives error on findOrInsert method in pit.cpp file and I don't understand its reason.
> auto entry = make_shared<Entry>(interest);
> Can anybody help me with this? Why I'm getting this error? Which method should I continue with?
> -- 
> Regards,
> Mudasir Qazi

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

More information about the ndnSIM mailing list