[ndnSIM] How to change prefix name?

최원준 wonjunchoi001 at gmail.com
Wed Jan 14 06:53:51 PST 2015


Thanks for your explanation.

Best regards
Wonjun, Choi

2015-01-14 23:36 GMT+09:00 Alex Afanasyev <alexander.afanasyev at ucla.edu>:

> Hi Wonjun,
>
> Negative indices is just a convenience way to get access name components
> from the back of the name.  The same (but a little longer) would be to write
>
> x.get(x.size() - 1).toSeqNum();
>
>> Alex
>
> On Jan 14, 2015, at 2:28 AM, 최원준 <wonjunchoi001 at gmail.com> wrote:
>
> Thanks for your comment. btw, I wonder what it means.(-1 index)
>
> Wonjun, Choi
>
> 2015-01-14 15:57 GMT+09:00 Alex Afanasyev <alexander.afanasyev at ucla.edu>:
>
>> While it is possible to do what you're asking, I would actually suggest a
>> different solution.  You can get the number stored in the name component
>> and print it in readable form, instead of just printing the name.
>>
>> For example,
>>
>> std::cout << x.get(-1).toSeqNum();
>>
>> ---
>> Alex
>>
>> > On Jan 14, 2015, at 1:40 AM, 최원준 <wonjunchoi001 at gmail.com> wrote:
>> >
>> > Hello.
>> >
>> > I want to change prefix name like 1, 2, 3, ... instead of /%00Z ...
>> > The code below displays the prefix name.
>> > ---------------------------------------------------------------
>> > for (int i = 0; i < 300; i++) {
>> > ndn::Name x;
>> > x.appendSeqNum(i);
>> > std::cout << i << " = " << x << std::endl;
>> > }
>> > return 0;
>> > ---------------------------------------------------------------
>> > how can I set the prefix like /v1/1, /v1/2, ...?
>> >
>> > Wonjun, Choi
>> > _______________________________________________
>> > ndnSIM mailing list
>> > ndnSIM at lists.cs.ucla.edu
>> > http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>>
>
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20150114/e0b3cb0b/attachment.html>


More information about the ndnSIM mailing list