That's how C++ classes work. If you declare a variable inside a method that variable gets declared every time the method is called. If you want the variable to keep state between method calls you need to declare it as a member of the class inside the class declaration.
For more information see any tutorial on C++ classes and look for variable scope. Nathan On Sunday, June 15, 2014, MHMND Herath <mh...@ou.ac.lk> wrote: > Any c++ block which created by gr_modtool has this feature. > c++ block run with for(int i loop. This "i" becomes 0 after every 8191 > samples. When we put noutput_items=1000. "i" becomes 0 after every 1000 > samples, otherwise it becomes 8191 and return to 0 > Thanks > Neil Herath > http://www.trondeau.com/storage/tutorial/gr_scheduler_overview.pdf > > ---------- Original Message ----------- > From: "West, Nathan" <n...@ostatemail.okstate.edu <javascript:;>> > To: MHMND Herath <mh...@ou.ac.lk <javascript:;>> > Cc: "discuss-gnuradio@gnu.org <javascript:;>" <discuss-gnuradio@gnu.org > <javascript:;>> > Sent: Sat, 14 Jun 2014 19:22:08 -0400 > Subject: Re: [Discuss-gnuradio] gnuradio schedular > > > On Fri, Jun 13, 2014 at 11:46 PM, MHMND Herath <mh...@ou.ac.lk > <javascript:;>> wrote: > > > Dear sir > > > I experienced that after every 8191 samples variables of blocks > becomes 0. > > > What is this 8191 limit?. I showed in gr_scheduler_overwive.pdf, > N=2048. Is > > > 2048 number of samples? I noticed that 2048*4=8129. Please explain > what 2048 > > > and 8129 > > > > > > Thanks > > > Neil Herath > > > > > > > Hi Neil, > > > > It's not clear (to me) what you're talking about here. To answer any > > question it would help if you added a link to external documents, > > mentioned a block (or blocks) that you're having problems with, and > > describe the flowgraph/application that it occurs in. > > > > Nathan > ------- End of Original Message ------- > >
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio