[ndnSIM] My Test file for manipulating/playing with the content store

John Baugh jpbaugh at umich.edu
Sun Nov 6 21:38:52 PST 2016

Greetings all,

I have written some code that I'm basically trying to use to just play
around with the content store for the purpose of learning how to use it.  I
figured I could create (or retrieve) an instance of it, and treat it mostly
like a container/data structure and use the methods, such as insert on it.
I tried making my own custom Cs instance, and when that didn't work I used
the technique Junxiao suggested by obtaining the L3Protocol, and then from
that obtaining a forwarder and then getting the content store that way.

I assumed that once a content store was obtained, that I could do things
like call "insert" on it directly.

However, although what i have attached does compile, I get a termination
error saying that the error was "bad weak_ptr".

I've spent several years not as focused on C++, so I will be the first to
admit I'm not as up to speed on the smart/managed pointers as i should be,
but i do know that weak_ptr is a type of associated smart pointer that
doesn't own the object that it is referencing.  But even after using GDB, I
still don't really know what's causing this problem.  Java and C# have
spoiled me... I'll admit.

Any help would be greatly appreciated.  I am beginning to put together
notes and maybe some day in the near future I'll have a little sandbox
tutorial for people to at least get use to the data structures and such
with a more extensive treatment.  I'm a community college instructor,
adjunct at U of M, as well as doing this PhD research, so once I truly
understand this stuff better, I think I can really contribute especially in
the form of instructional materials.

Thanks a ton, everyone.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20161107/9783f84e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jpb-test.cpp
Type: text/x-c++src
Size: 2730 bytes
Desc: not available
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20161107/9783f84e/attachment.bin>

More information about the ndnSIM mailing list