<p dir="ltr">While we're in a similar discussion, what about the contents of the CS?<br>
</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Nov 3, 2016 5:50 PM, "Junxiao Shi" <<a href="mailto:shijunxiao@email.arizona.edu">shijunxiao@email.arizona.edu</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Runtong<div><br></div><div>Spyros has given the right way to do it. I'll address why the two snippets are wrong.</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p>Ptr<nfd::Pit> pit = node->GetObject<nfd::Pit> ();</p></blockquote><div>In <a href="https://www.nsnam.org/docs/release/3.25/manual/html/object-model.html" target="_blank">ns-3 object model</a>, ObjectBase::GetObject can return an object aggregated into the current object, or cast the current object as a subclass type. nfd::Pit is not aggregated into the node, so this does not work.</div><div>If ndnSIM is designed ground-up following ns-3 principles, nfd::Pit should be aggregated. But nfd::Pit is imported from NFD codebase that is not designed for ns-3, so that it's not aggregated.</div><div><br></div><div>ns3::ndn::L3Protocol, as mentioned in Spyros's answer, is aggregated into the node, and serves as an entrypoint to access NFD's objects.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p>Ptr<nfd::pit::Entry> entry = node->GetObject<nfd::pit::Entr<wbr>y> ();</p></blockquote><div>ns-3 object model allows only one instance of each object to be aggregated. Since each node has multiple Interest Table entries, it's wrong to aggregate the entry.</div></div><div>Similarly, a ns3::NetDevice is not aggregated into a ns3::Node.</div><div><br></div><div>Yours, Junxiao</div></div>
<br>______________________________<wbr>_________________<br>
ndnSIM mailing list<br>
<a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>
<a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" rel="noreferrer" target="_blank">http://www.lists.cs.ucla.edu/<wbr>mailman/listinfo/ndnsim</a><br>
<br></blockquote></div></div>