[ndnSIM] The use of DidAddEntry and WillRemoveEntry

Boubakr Nour n.boubakr at outlook.com
Fri Dec 28 00:46:40 PST 2018


Hello,

I am trying to use "DidAddEntry" and "WillRemoveEntry". I defined my functions and config statements as follows:

void CacheEntryAdded(std::string context, Ptr<const ndn::cs::Entry> entry, Time lifetime) {
std::cout << lifetime.ToDouble(Time::S) << "\tAdd\t" << entry->GetName() << std::endl;
}

void CacheEntryRemoved(std::string context, Ptr<const ndn::cs::Entry> entry, Time lifetime) {
std::cout << lifetime.ToDouble(Time::S) << "\tRemove\t" << entry->GetName() << std::endl;
}

...

ndnHelper.SetOldContentStore("ns3::ndn::cs::Stats", "MaxSize", "10");
ndnHelper.InstallAll();

Config::Connect("/NodeList/*/$ns3::ndn::cs::Stats::Lru/WillRemoveEntry", MakeCallback(CacheEntryRemoved));
Config::Connect("/NodeList/*/$ns3::ndn::cs::Lru::LifetimeStats/DidAddEntry", MakeCallback(CacheEntryAdded));


But I am getting this error:

msg="Incompatible types. (feed to "c++filt -t" if needed)
got=CallbackImpl<void,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,ns3::Ptr<ns3::ndn::cs::Entry const>,ns3::Time>
expected=CallbackImpl<void,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,ns3::Ptr<ns3::ndn::cs::Entry const>>", file=./ns3/callback.h, line=1449
msg="when connecting to /NodeList/0/$ns3::ndn::cs::Lru::LifetimeStats/DidAddEntry", file=./ns3/traced-callback.h, line=280
terminate called without an active exception

However, when I use only "WillRemoveEntry", I can get the output successfully.

Regards,
Boubakr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20181228/fb54e320/attachment.html>


More information about the ndnSIM mailing list