<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi John,</div><div class=""><br class=""></div><div class="">The magic comes from NS-3's object system (in addition to standard object system that C++ provides).  For the class to be found by the name, e.g., in the AppHelper constructor, it needs to be so called "registered".</div><div class=""><br class=""></div><div class="">It is just a matter of adding `NS_OBJECT_ENSURE_REGISTERED(YourClass);` and implementing YourClass::GetTypeId() method that defines name, constructor, and any parameters that you wish.</div><div class=""><br class=""></div><div class="">Check apps/ndn-consumer-cbr.cpp for example.  You'll find similar code in many other "ns3::Object"-derived classes.</div><div class=""><br class=""></div><div class="">--</div><div class="">Alex</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 30, 2016, at 9:27 PM, John Baugh <<a href="mailto:jpbaugh@umich.edu" class="">jpbaugh@umich.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">ndnSIM friends,<div class=""><br class=""></div><div class="">In one of the examples, there is a line:</div><div class=""><br class=""></div><div class="">ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");<br class=""></div><div class=""><br class=""></div><div class="">Where does it know to find ConsumerCbr?  Do I just have to put the namespace and scope resolution operators if I, for example, create a <b class="">custom consumer</b>, producer, or other app?</div><div class=""><br class=""></div><div class="">Also, there appears to be an <b class="">error in the documentation</b>, </div><div class=""><br class=""></div><div class=""><a href="http://ndnsim.net/2.2/doxygen/classns3_1_1ndn_1_1AppHelper.html#a67d941c1628aceef4b8add5c564ed3df" class="">http://ndnsim.net/2.2/doxygen/classns3_1_1ndn_1_1AppHelper.html#a67d941c1628aceef4b8add5c564ed3df</a><br class=""></div><div class=""><br class=""></div><div class="">The parameter named in the constructor (the const string reference) is named <b class="">prefix</b> in the header, but the description names it <b class="">app</b>.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">John</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=""></body></html>