Access to history before there is one (Block writing question)

I’m in the process of writing a basic block inherited from
gr_sync_interpolator which uses the past values to do stuff.

When the block first starts, the history is populated with zeros, is
there some way to get a pointer to the history in the constructor so I
can change the initial values?

Thanks

Jason

On Wed, Mar 11, 2009 at 02:10:19PM -0500, Jason U. wrote:

I’m in the process of writing a basic block inherited from
gr_sync_interpolator which uses the past values to do stuff.

When the block first starts, the history is populated with zeros, is
there some way to get a pointer to the history in the constructor so I
can change the initial values?

Thanks
Jason

Sorry, no.

Eric

Sorry, no.

Eric

OK,

Is there a way to distinguish between an uninitialized history (which
seems to be all 0’s) and a history whose data is all 0’s?

Or perhaps some way that the work function knows this that it is the
first time being called (I am currently kludging it with a class
variable, ‘cleared_buffer’)

Thanks

Jason

On Thu, Apr 02, 2009 at 09:30:47AM -0500, Jason U. wrote:

Sorry, no.

Eric

OK,

Is there a way to distinguish between an uninitialized history (which
seems to be all 0’s) and a history whose data is all 0’s?

No. 0 == 0 :slight_smile:

Or perhaps some way that the work function knows this that it is the
first time being called (I am currently kludging it with a class
variable, ‘cleared_buffer’)

The instance variable should do it.

Eric