Smart pointer problem

Hi,

I’m fighting a bit with a smart pointer. I want to apply a filter in my
block. Hence I construct a filter as shown below:

gr_fir_filter_fff_sptr hi_pass = gr_make_fir_filter_fff(1,
gr_firdes::high_pass (1.0,
64000,
5000,
1000,
gr_firdes::WIN_HAMMING,
6.76
));

as soon as I dereference the smart pointer in order to use the filter I
get an assertion error: const [with T = gr_block_detail]: Assertion `px
!= 0’ failed.

hi_pass->general_work(noutput_items, ninput_items, input_items,
output_items);

this means the smart pointer doesn’t have a pointer (any longer?) to the
filter. Does anyone see what I’m doing wrong. I’ve been trying quite
hard to find the mistake but I simply don’t get it.

Cheers,

John.

On 03/01/2011 11:36 PM, johan kuijpers wrote:

                gr_firdes::WIN_HAMMING,

this means the smart pointer doesn’t have a pointer (any longer?) to the
filter. Does anyone see what I’m doing wrong. I’ve been trying quite
hard to find the mistake but I simply don’t get it.

It looks like you are using the shared pointer correctly, but perhaps
there is something else that the scheduler sets-up that you are missing
by using the block in a stand-alone fashion. Only the gurus know.

You may want to use the vector source -> block -> vector sink paradigm
that all the qa code uses; to process a single chunk of samples.

-Josh