<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Do you really want to modify PIT entry? If you simply need to store additional information alongside each/specific PIT entries that your strategy uses, NFD has a mechanism for that.   You just need to implement a class derived from StrategyInfo and add it/look it up from the entry when needed.  Example of this is in the AccessStrategy (<a href="https://github.com/named-data/NFD/blob/master/daemon/fw/access-strategy.hpp#L73" class="">https://github.com/named-data/NFD/blob/master/daemon/fw/access-strategy.hpp#L73</a>), so you can do similar stuff.<div class=""><br class=""></div><div class="">As for the error, you have used a wrong member class selector. With "." you are trying to access members of "shared_ptr" class.  If you replace with "->", you will be access the right thing.</div><div class=""><br class=""></div><div class="">-</div><div class="">Alex<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 4, 2020, at 1:31 PM, nabil khemache via ndnSIM <<a href="mailto:ndnsim@lists.cs.ucla.edu" class="">ndnsim@lists.cs.ucla.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hello to all</div><div class="">I'm trying to modify the pit-entry structure, and i've started with something very simple, just one private integer and two member function (set and get).</div><div class=""><br class=""></div><div class="">In the pit-entry. hpp i've done this:</div><div class="">public:</div><div class=""><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:14px;line-height:19px;white-space:pre" class=""><div class=""><span style="color:rgb(212,212,212)" class="">  </span><span style="color:rgb(86,156,214)" class="">public:</span></div><div class=""><span style="color:rgb(86,156,214)" class="">  void</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  </span><span style="color:rgb(220,220,170)" class="">setinteger</span><span style="color:rgb(212,212,212)" class="">(</span><span style="color:rgb(86,156,214)" class="">int</span><span style="color:rgb(212,212,212)" class=""> </span><span style="color:rgb(156,220,254)" class="">value</span><span style="color:rgb(212,212,212)" class="">)</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  {</span></div><div class=""><span style="color:rgb(212,212,212)" class="">    m_integer</span><span style="color:rgb(212,212,212)" class="">=</span><span style="color:rgb(212,212,212)" class="">value;</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  }</span></div><br class=""><div class=""><span style="color:rgb(212,212,212)" class="">  </span><span style="color:rgb(86,156,214)" class="">int</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  </span><span style="color:rgb(220,220,170)" class="">getinteger</span><span style="color:rgb(212,212,212)" class="">() </span><span style="color:rgb(86,156,214)" class="">const</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  {</span></div><div class=""><span style="color:rgb(212,212,212)" class="">    </span><span style="color:rgb(197,134,192)" class="">return</span><span style="color:rgb(212,212,212)" class=""> m_integer;</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  }</span></div></div></div><div class="">and this<br class=""></div><div class=""><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:14px;line-height:19px;white-space:pre" class=""><div class=""><span style="color:rgb(86,156,214)" class="">private:</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  shared_ptr</span><span style="color:rgb(212,212,212)" class=""><</span><span style="color:rgb(86,156,214)" class="">const</span><span style="color:rgb(212,212,212)" class=""> Interest</span><span style="color:rgb(212,212,212)" class="">></span><span style="color:rgb(212,212,212)" class=""> m_interest;</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  InRecordCollection m_inRecords;</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  OutRecordCollection m_outRecords;</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  </span><span style="color:rgb(78,201,176)" class="">name_tree</span><span style="color:rgb(212,212,212)" class="">::Entry</span><span style="color:rgb(212,212,212)" class="">*</span><span style="color:rgb(212,212,212)" class=""> m_nameTreeEntry;</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  </span><span style="color:rgb(86,156,214)" class="">int</span><span style="color:rgb(212,212,212)" class=""> m_integer;</span></div></div></div><div class="">also i've modified the constructor to initialize the value, so in the pit-entry.cpp i did this:</div><div class=""><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:14px;line-height:19px;white-space:pre" class=""><div class=""><span style="color:rgb(86,156,214)" class="">namespace</span><span style="color:rgb(212,212,212)" class=""> </span><span style="color:rgb(78,201,176)" class="">nfd</span><span style="color:rgb(212,212,212)" class=""> {</span></div><div class=""><span style="color:rgb(86,156,214)" class="">namespace</span><span style="color:rgb(212,212,212)" class=""> </span><span style="color:rgb(78,201,176)" class="">pit</span><span style="color:rgb(212,212,212)" class=""> {</span></div><br class=""><div class=""><span style="color:rgb(78,201,176)" class="">Entry</span><span style="color:rgb(212,212,212)" class="">::</span><span style="color:rgb(220,220,170)" class="">Entry</span><span style="color:rgb(212,212,212)" class="">(</span><span style="color:rgb(86,156,214)" class="">const</span><span style="color:rgb(212,212,212)" class=""> Interest</span><span style="color:rgb(212,212,212)" class="">&</span><span style="color:rgb(156,220,254)" class=""> interest</span><span style="color:rgb(212,212,212)" class="">)</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  : </span><span style="color:rgb(220,220,170)" class="">isSatisfied</span><span style="color:rgb(212,212,212)" class="">(</span><span style="color:rgb(86,156,214)" class="">false</span><span style="color:rgb(212,212,212)" class="">)</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  , </span><span style="color:rgb(220,220,170)" class="">dataFreshnessPeriod</span><span style="color:rgb(212,212,212)" class="">(</span><span style="color:rgb(181,206,168)" class="">0_ms</span><span style="color:rgb(212,212,212)" class="">)</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  , </span><span style="color:rgb(220,220,170)" class="">m_interest</span><span style="color:rgb(212,212,212)" class="">(</span><span style="color:rgb(156,220,254)" class="">interest</span><span style="color:rgb(212,212,212)" class="">.</span><span style="color:rgb(220,220,170)" class="">shared_from_this</span><span style="color:rgb(212,212,212)" class="">())</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  , </span><span style="color:rgb(220,220,170)" class="">m_nameTreeEntry</span><span style="color:rgb(212,212,212)" class="">(</span><span style="color:rgb(86,156,214)" class="">nullptr</span><span style="color:rgb(212,212,212)" class="">)</span></div><div class=""><span style="color:rgb(212,212,212)" class="">  , </span><span style="color:rgb(220,220,170)" class="">m_integer</span><span style="color:rgb(212,212,212)" class="">(</span><span style="color:rgb(181,206,168)" class="">0</span><span style="color:rgb(212,212,212)" class="">)</span></div><div class=""><span style="color:rgb(212,212,212)" class="">{</span></div><br class=""><div class=""><span style="color:rgb(212,212,212)" class="">}</span></div></div></div><div class="">like you see, it's a very basic modification, but when i try to call one of those member functions, like, in the MulticastStrategy functions: <br class=""></div><div class=""><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:14px;line-height:19px;white-space:pre" class=""><div class=""><span style="color:rgb(86,156,214)" class="">void</span></div><div class=""><span style="color:rgb(78,201,176)" class="">MulticastStrategy</span><span style="color:rgb(212,212,212)" class="">::</span><span style="color:rgb(220,220,170)" class="">afterReceiveInterest</span><span style="color:rgb(212,212,212)" class="">(</span><span style="color:rgb(86,156,214)" class="">const</span><span style="color:rgb(212,212,212)" class=""> Face</span><span style="color:rgb(212,212,212)" class="">&</span><span style="color:rgb(156,220,254)" class=""> inFace</span><span style="color:rgb(212,212,212)" class="">, </span><span style="color:rgb(86,156,214)" class="">const</span><span style="color:rgb(212,212,212)" class=""> Interest</span><span style="color:rgb(212,212,212)" class="">&</span><span style="color:rgb(156,220,254)" class=""> interest</span><span style="color:rgb(212,212,212)" class="">,</span></div><div class=""><span style="color:rgb(212,212,212)" class="">                                        </span><span style="color:rgb(86,156,214)" class="">const</span><span style="color:rgb(212,212,212)" class=""> shared_ptr</span><span style="color:rgb(212,212,212)" class=""><</span><span style="color:rgb(78,201,176)" class="">pit</span><span style="color:rgb(212,212,212)" class="">::Entry</span><span style="color:rgb(212,212,212)" class="">>&</span><span style="color:rgb(156,220,254)" class=""> pitEntry</span><span style="color:rgb(212,212,212)" class="">)</span></div><div class=""><span style="color:rgb(212,212,212)" class="">{</span></div><div class=""><span style="color:rgb(212,212,212)" class="">   <br class=""></span><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:14px;line-height:19px;white-space:pre" class=""><div class=""><span style="color:rgb(212,212,212)" class="">            </span><span style="color:rgb(156,220,254)" class="">pitEntry</span><span style="color:rgb(212,212,212)" class="">.</span><span style="color:rgb(156,220,254)" class="">m_integer</span><span style="color:rgb(212,212,212)" class="">=</span><span style="color:rgb(181,206,168)" class="">100</span><span style="color:rgb(212,212,212)" class="">;</span></div><div class=""><span style="color:rgb(212,212,212)" class=""><br class=""></span></div></div></div><div class=""><span style="color:rgb(212,212,212)" class=""><br class=""></span></div></div></div><div class="">I get this error message : <br class=""></div><div class=""><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:14px;line-height:19px;white-space:pre" class=""><div class="">[2365/3208] Compiling src/ndnSIM/NFD/daemon/fw/multicast-strategy.cpp<br class="">../src/ndnSIM/NFD/daemon/fw/multicast-strategy.cpp: In member function ‘virtual void nfd::fw::MulticastStrategy::afterReceiveInterest(const nfd::face::Face&, const ndn::Interest&, const std::shared_ptr<nfd::pit::Entry>&)’:<br class="">../src/ndnSIM/NFD/daemon/fw/multicast-strategy.cpp:122:22: error: ‘const class std::shared_ptr<nfd::pit::Entry>’ has no member named ‘setinteger’<br class="">             pitEntry.setinteger(100);<br class="">                      ^<br class=""></div></div></div><div class=""><br class=""></div><div class="">If anyone can help, i would be very grateful.</div><div class="">thanks in advance<br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div>
_______________________________________________<br class="">ndnSIM mailing list<br class=""><a href="mailto:ndnSIM@lists.cs.ucla.edu" class="">ndnSIM@lists.cs.ucla.edu</a><br class="">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim<br class=""></div></blockquote></div><br class=""></div></body></html>