[ndnSIM] A Problem About NS-3 Object

乐舒原 leshuyuan at 163.com
Sat Oct 26 20:38:41 PDT 2013


Hello Everybody:
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:
Firstly,
void MyFwStrategy_InterestRate::AddFace(Ptr<Face> face){ 
NS_LOG_DEBUG("in addface");
 ObjectFactory factory;
NS_LOG_DEBUG("in addface"); 
const std::string typeId="ns3::ndn::InterestSatisfiedRate"; 
NS_LOG_DEBUG("in addface"); 
factory.setTypeId(typeId); 
NS_LOG_DEBUG("in addface"); 
Ptr<InterestSatisfiedRate> interestSatisfiedRate = factory.Create(); 
NS_LOG_DEBUG("in addface");
 face->AggregateObject( interestSatisfiedRate); 
}
The problem is the fifth Log didn't print.That means the problem happens when Create the InterestSatisfiedRate Object.
Secondly,
void MyFwStrategy_InterestRate::AddFace(Ptr<Face> face){
NS_LOG_DEBUG("in addface");
Ptr<InterestSatisfiedRate> interestSatisfiedRate =CreateObject<InterestSatisfiedRate>();
NS_LOG_DEBUG("in addface");
face->AggregateObject( interestSatisfiedRate);
NS_LOG_DEBUG("in addface");
}
The problem is the third Log didn't print.That means the problem happens when the face aggretate  the InterestSatisfiedRate Object.
Can someone help me solve the trouble?
Thanks So Much!


 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20131027/93f9b5d3/attachment.html>


More information about the ndnSIM mailing list