<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you for your help.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:mastorakis@cs.ucla.edu">Spyridon (Spyros) Mastorakis</a><br>
<b>Sent: </b>Monday, December 31, 2018 20:21<br>
<b>To: </b><a href="mailto:n.boubakr@outlook.com">Boubakr Nour</a><br>
<b>Cc: </b><a href="mailto:ndnsim@lists.cs.ucla.edu">Ndnsim</a><br>
<b>Subject: </b>Re: [ndnSIM] The use of DidAddEntry and WillRemoveEntry</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi,<br>
<br>
these 2 callbacks are different. The error message tells you the reason: the signature of your callback does not match the expected signature.<br>
<br>
“DidAddEntry” does not require the third argument (i.e., Time lifetime).<br>
<br>
Thanks,<br>
<br>
Spyridon (Spyros) Mastorakis<br>
Personal Website: <a href="http://cs.ucla.edu/~mastorakis/">http://cs.ucla.edu/~mastorakis/</a><br>
Internet Research Laboratory<br>
Computer Science Department<br>
UCLA<br>
<br>
> On Dec 28, 2018, at 10:46 AM, Boubakr Nour <n.boubakr@outlook.com> wrote:<br>
> <br>
> Hello,<br>
> <br>
> I am trying to use "DidAddEntry" and "WillRemoveEntry". I defined my functions and config statements as follows:<br>
> <br>
> void CacheEntryAdded(std::string context, Ptr<const ndn::cs::Entry> entry, Time lifetime) {<br>
> std::cout << lifetime.ToDouble(Time::S) << "\tAdd\t" << entry->GetName() << std::endl;<br>
> }<br>
> <br>
> void CacheEntryRemoved(std::string context, Ptr<const ndn::cs::Entry> entry, Time lifetime) {<br>
> std::cout << lifetime.ToDouble(Time::S) << "\tRemove\t" << entry->GetName() << std::endl;<br>
> }<br>
> <br>
> ...<br>
> <br>
> ndnHelper.SetOldContentStore("ns3::ndn::cs::Stats", "MaxSize", "10");<br>
> ndnHelper.InstallAll();<br>
> <br>
> Config::Connect("/NodeList/*/$ns3::ndn::cs::Stats::Lru/WillRemoveEntry", MakeCallback(CacheEntryRemoved));<br>
> Config::Connect("/NodeList/*/$ns3::ndn::cs::Lru::LifetimeStats/DidAddEntry", MakeCallback(CacheEntryAdded));<br>
> <br>
> <br>
> But I am getting this error:<br>
> <br>
> msg="Incompatible types. (feed to "c++filt -t" if needed)<br>
> got=CallbackImpl<void,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,ns3::Ptr<ns3::ndn::cs::Entry const>,ns3::Time><br>
> 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<br>
> msg="when connecting to /NodeList/0/$ns3::ndn::cs::Lru::LifetimeStats/DidAddEntry", file=./ns3/traced-callback.h, line=280<br>
> terminate called without an active exception<br>
> <br>
> However, when I use only "WillRemoveEntry", I can get the output successfully.<br>
> <br>
> Regards,<br>
> Boubakr<br>
> _______________________________________________<br>
> ndnSIM mailing list<br>
> ndnSIM@lists.cs.ucla.edu<br>
> <a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>