[ndnSIM] check content store entries periodically ?
jpbaugh at umich.edu
Fri Dec 22 21:29:57 PST 2017
Perhaps this would help a bit:
You basically create a callback function with the behavior you want - you
pass the function pointer (similar to a delegate method, or closure in some
other languages) to the static Schedule method of the Simulator.
So, you'd create a method like this:
*handler(ofstream* outfile, int iteration) *
* (*outfile)<<"Testing iteration "<<iteration<<std::endl; *
Then, in your scenario, you schedule it to occur at a particular interval:
*Simulator::Schedule(Seconds(1), &handler, &outfile, i);*
This example is quite trivial, but you can make them arbitrarily complex.
I.e., you can, after the initial &handler, pass any of the necessary
parameters that your handler takes, to the Schedule method.
Also, this page might be useful (just search for Schedule) :
On Thu, Dec 21, 2017 at 11:46 AM, Spyridon (Spyros) Mastorakis <
mastorakis at cs.ucla.edu> wrote:
> this is some custom functionality that you will have to implement on your
> own. You can schedule periodic events with the Simulator::Schedule method
> of NS-3 and iterate over the CS entries with the CS iterators. Take a look
> here for more details:
> Spyridon (Spyros) Mastorakis
> Personal Website: http://cs.ucla.edu/~mastorakis/
> Internet Research Laboratory
> Computer Science Department
> On Dec 20, 2017, at 4:35 PM, Chengb Cao <chengbcao at gmail.com> wrote:
> Is there any way to get the CS entries periodically during my simulation,
> and what methods should i use?
> using ndnSIM 2.4 here.
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ndnSIM