<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi!<div><br></div><div>I'm not sure how your code compiles.  "Ptr<InterestSatisfiedRate> interestSatisfiedRate = factory.Create();"  should fail, since "factory.Create()" creates Ptr<Object> which needs to be dynamically casted to be assigned as InterestSatisfiedRate.</div><div><br></div><div>If the code compiles but it fails at some point, my recommendation would be to use gdb to see what exactly is going wrong.</div><div><br></div><div>---</div><div>Alex</div><div><br><div><div>On Oct 26, 2013, at 8:38 PM, δΉθˆ’εŽŸ <<a href="mailto:leshuyuan@163.com">leshuyuan@163.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="line-height: 1.7; font-size: 14px; font-family: arial; ">Hello Everybody:<div><span class="Apple-tab-span" style="white-space:pre">      </span>I'm a newer in learning ndnSIM adn ns-3.I have a problem about ns-3 object when I programming my own forwarding strategy imitating the PerOutFaceLimits class.The problem are as follow:</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>Firstly,</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>void MyFwStrategy_InterestRate::AddFace(Ptr<Face> face){ </div><div><span class="Apple-tab-span" style="white-space:pre">         </span>NS_LOG_DEBUG("in addface");</div><div> <span class="Apple-tab-span" style="white-space:pre">          </span>ObjectFactory factory;</div><div><span class="Apple-tab-span" style="white-space:pre">               </span>NS_LOG_DEBUG("in addface"); </div><div><span class="Apple-tab-span" style="white-space:pre">          </span>const std::string typeId="ns3::ndn::InterestSat!
 isfiedRat
 e"; </div><div><span class="Apple-tab-span" style="white-space:pre">           </span>NS_LOG_DEBUG("in addface"); </div><div><span class="Apple-tab-span" style="white-space:pre">          </span>factory.setTypeId(typeId); </div><div><span class="Apple-tab-span" style="white-space:pre">             </span>NS_LOG_DEBUG("in addface"); </div><div><span class="Apple-tab-span" style="white-space:pre">          </span>Ptr<InterestSatisfiedRate> interestSatisfiedRate = factory.Create(); </div><div><span class="Apple-tab-span" style="white-space:pre">             </span>NS_LOG_DEBUG("in addface");</div><div><span class="Apple-tab-span" style="white-space:pre">                </span> face->AggregateObject( interestSatisfiedRate); </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>The problem is the fifth Log didn't print.That means the problem happens when Create the InterestSatisfiedRate Object.</div><div><!--
 span clas
 s="Apple-tab-span" style="white-space:pre"-->   Secondly,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>void MyFwStrategy_InterestRate::AddFace(Ptr<Face> face){</div><div><span style="line-height: 1.7;"><span class="Apple-tab-span" style="white-space:pre">               </span>NS_LOG_DEBUG("in addface");</span></div><div><span class="Apple-tab-span" style="white-space:pre">           </span>Ptr<InterestSatisfiedRate> interestSatisfiedRate =CreateObject<InterestSatisfiedRate>();</div><div><span class="Apple-tab-span" style="white-space:pre">         </span>NS_LOG_DEBUG("in addface");</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>face->AggregateObject( interestSatisfiedRate);</div><div><span class="Apple-tab-span" style="white-space:pre">            </span>NS_LOG_DEBUG("in addface");</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><span style="line-height: 1.7;"><span class="Apple-tab-span" style="white-sp!
 ace:pre">
        </span>The problem is the third Log didn't print.That means the problem happens when the face aggretate  the InterestSatisfiedRate Object.</span></div><div><span style="line-height: 1.7;"><span class="Apple-tab-span" style="white-space:pre">        </span>Can someone help me solve the trouble?</span></div><div><span style="line-height: 1.7;"><span class="Apple-tab-span" style="white-space:pre">  </span>Thanks So Much!</span></div><div><span class="Apple-tab-span" style="white-space:pre"> </span></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">    </span></div> <br><div><br></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim<br></blockquote></div><br></div></body></html>