<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi,
<div class=""><br class="">
</div>
<div class="">Name.get(2).toUri() should return a string of the 3rd name component. I suppose the index of the get() method of the Name class starts from 0.</div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class=""><br class="">
<div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div>Spyridon (Spyros) Mastorakis<br class="">
Assistant Professor<br class="">
Computer Science Department<br class="">
University of Nebraska, Omaha<br class="">
Peter Kiewit Institute Room 175A<br class="">
<a href="https://sites.google.com/site/spyridonmastorakis" class="">https://sites.google.com/site/spyridonmastorakis</a></div>
</div>
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Oct 25, 2020, at 6:31 AM, Hafsteinn Hjartarson via ndnSIM <<a href="mailto:ndnsim@lists.cs.ucla.edu" class="">ndnsim@lists.cs.ucla.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hi everyone!
<div class=""><br class="">
</div>
<div class="">I have a question regarding how applications can deal with different interest names.</div>
<div class=""><br class="">
</div>
<div class="">Take for example the custom application ndn-custom-app-producer.cpp</div>
<div class=""><br class="">
</div>
<div class="">Let's say that I want the producer application to handle different operations such as adding a hash to a list, deleting a has from a list and returning some data regarding a certain hash:</div>
<div class=""><br class="">
</div>
<div class="">"/prefix/sub/<b class="">add</b>/{some hash}"</div>
<div class="">"/prefix/sub/<b class="">delete</b>/{some hash}"</div>
<div class="">"/prefix/sub/<b class="">get</b>/{some hash}"</div>
<div class=""><br class="">
</div>
<div class="">So another application (a consumer) can send the above interests but how should my producer application handle this?</div>
<div class=""><br class="">
</div>
<div class="">Currently I am doing this:</div>
<div class=""><br class="">
</div>
<div class="">I add "/prefix/sub" to the FIB so that my producer listens to everything coming in on that prefix. </div>
<div class=""><br class="">
</div>
<div class="">Then I have this logic:</div>
<div class=""><br class="">
</div>
<div class="">onInterest(){</div>
<div class="">  if(interest -> getName().get(3).value() == "add")</div>
<div class="">  {</div>
<div class="">     //add the data</div>
<div class="">  }</div>
<div class="">  else if (interest -> getName().get(3).value() == "delete")</div>
<div class="">  {</div>
<div class="">      //delete the data</div>
<div class="">   }<br class="">
   else if (interest -> getName().get(3).value() == "get")</div>
<div class="">   {</div>
<div class="">      //create a data packet and send the data to the consumer</div>
<div class="">   }</div>
<div class="">}</div>
<div class=""><br class="">
</div>
<div class="">Is this the correct way ?</div>
<div class=""><br class="">
</div>
<div class="">Best regards,</div>
<div class="">Hafsteinn</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="">
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.lists.cs.ucla.edu_mailman_listinfo_ndnsim&d=DwICAg&c=Cu5g146wZdoqVuKpTNsYHeFX_rg6kWhlkLF8Eft-wwo&r=eI5Bh74ovG-uIXQ5ksQETSPgRFzmJXjIZXneCqw580E&m=ZJcrRLs3ctYEDgUU0ei0VorwcyfIQt4pWR7EG9NmK_o&s=JbkqAPn8-5Iqv29lB8xy6qQZNw5ExV5-SunKN12zUhA&e=
<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>