[ndnSIM] Ways to create new Interest object
shijunxiao at email.arizona.edu
Tue Apr 3 17:35:15 PDT 2018
> *Method #2:* Creating Interest from an existing Interest like this:
> const Name& tempName = "---";
> Interest tempInterest = Interest(interest.wireEncode());
> *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);
In certain contexts that use Interest::shared_from_this(), Interest must be
created using `make_shared`. Otherwise, .shared_from_this() will trigger
PIT is one of those contexts. So are many other places in NFD.
Thus, you need:
auto tempInterest = std::make_shared<Interest>(interest.wireEncode());
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ndnSIM