<div dir="ltr">Hi,<div><br></div><div>I'm trying to spontaneously inject a cached data (based on a previously unfulfilled interest present in PIT and so I have an interest handle to fetch data) from content store.</div><div><br></div><div>However, I'm facing some issues:</div><div><br></div><div>1) Derived strategy doesn't seem to have any handle to fowarder although base strategy has a handle and is friend to forwarder to access pipelines. </div><div>In order to workaround this I added my strategy also as a friend and gave it a reference to forwarder, similar to base strategy. Is there a better way to access pipeline from strategy?</div><div><br></div><div>2) To access data from CS and feed it to outgoing data pipeline, I follow similar mechanism as done on receiving valid interest from forwarder:</div><div>//fowarder.cpp</div><div><div>    if (m_csFromNdnSim == nullptr) {</div><div>      m_cs.find(interest,</div><div>                bind(&Forwarder::onContentStoreHit, this, ref(inFace), pitEntry, _1, _2),</div><div>                bind(&Forwarder::onContentStoreMiss, this, ref(inFace), pitEntry, _1));</div><div>    }</div></div><div><br></div><div>//myStrategy.cpp</div><div>    if (m_forwarder.m_csFromNdnSim == nullptr) {</div><div>        /* m_forwarder is a reference to forwarder */             </div><div><div><span style="white-space:pre">       </span>m_forwarder.m_cs.find(pe->getInterest(),</div><div>                  bind(&Forwarder::onContentStoreHit, &m_forwarder, ref(face), pe, _1, _2),</div><div><span style="white-space:pre">                </span>  bind(&Forwarder::onContentStoreMiss, &m_forwarder, ref(face), pe, _1));</div><div>     }</div></div><div><br></div><div>However this fails compilation and I get error as below:</div><div><br></div><div><div><font color="#ff0000">../src/ndnSIM/NFD/daemon/fw/my_strategy.cpp: In member function ‘virtual void nfd::fw::MyStrategy::beforeSatisfyInterest(std::shared_ptr<nfd::pit::Entry>, const nfd::Face&, const ndn::Data&)’:</font></div><div><font color="#ff0000">../src/ndnSIM/NFD/daemon/fw/my_strategy.cpp:243:75: error: no matching function for call to ‘nfd::cs::Cs::find(const ndn::Interest&, std::_Bind_helper<false, void (nfd::Forwarder::*)(const nfd::Face&, std::shared_ptr<nfd::pit::Entry>, const ndn::Interest&, const ndn::Data&), nfd::Forwarder*, std::reference_wrapper<int>, std::shared_ptr<nfd::pit::Entry>&, const std::_Placeholder<1>&, const std::_Placeholder<2>&>::type, std::_Bind_helper<false, void (nfd::Forwarder::*)(const nfd::Face&, std::shared_ptr<nfd::pit::Entry>, const ndn::Interest&), nfd::Forwarder*, std::reference_wrapper<int>, std::shared_ptr<nfd::pit::Entry>&, const std::_Placeholder<1>&>::type)’</font></div><div><font color="#ff0000">      bind(&Forwarder::onContentStoreMiss, &m_forwarder, ref(face), pe, _1));</font></div><div><font color="#ff0000">                                                                           ^</font></div><div><font color="#ff0000">In file included from ../src/ndnSIM/NFD/daemon/fw/forwarder.hpp:35:0,</font></div><div><font color="#ff0000">                 from ../src/ndnSIM/NFD/daemon/fw/strategy.hpp:29,</font></div><div><font color="#ff0000">                 from ../src/ndnSIM/NFD/daemon/fw/my_strategy.hpp:24,</font></div><div><font color="#ff0000">                 from ../src/ndnSIM/NFD/daemon/fw/my_strategy.cpp:21:</font></div><div><font color="#ff0000">../src/ndnSIM/NFD/daemon/fw/../table/cs.hpp:88:3: note: candidate: void nfd::cs::Cs::find(const ndn::Interest&, const HitCallback&, const MissCallback&) const</font></div><div><font color="#ff0000">   find(const Interest& interest,</font></div><div><font color="#ff0000">   ^</font></div><div><font color="#ff0000">../src/ndnSIM/NFD/daemon/fw/../table/cs.hpp:88:3: note:   no known conversion for argument 2 from ‘std::_Bind_helper<false, void (nfd::Forwarder::*)(const nfd::Face&, std::shared_ptr<nfd::pit::Entry>, const ndn::Interest&, const ndn::Data&), nfd::Forwarder*, std::reference_wrapper<int>, std::shared_ptr<nfd::pit::Entry>&, const std::_Placeholder<1>&, const std::_Placeholder<2>&>::type {aka std::_Bind<std::_Mem_fn<void (nfd::Forwarder::*)(const nfd::Face&, std::shared_ptr<nfd::pit::Entry>, const ndn::Interest&, const ndn::Data&)>(nfd::Forwarder*, std::reference_wrapper<int>, std::shared_ptr<nfd::pit::Entry>, std::_Placeholder<1>, std::_Placeholder<2>)>}’ to ‘const HitCallback& {aka const std::function<void(const ndn::Interest&, const ndn::Data&)>&}’</font></div></div><div><br></div><div>Can somebody help me figure out why this fails when similar invocation from forwarder passes?</div><div><br></div><div>Thanks in advance,</div><div>Rakesh</div><div><br></div></div>