On 06/06/2014 07:44 PM, Ed Criscuolo wrote:
> I've recently converted to GR 3.7, and am currently on 3.7.3.

Welcome :)

> I have created and run a new block in C++, but now want to add
> an accessor method to the block's class.  I defined it in
> <new_class_name>_impl.h , in the public part of the
> class declaration as follows:
> 
>       float get_samples_per_second(void)
>         {
>           return d_samples_per_second;
>         }
> 
> This compiles fine, but when I try to access it from
> GRC via a function probe, I get:
> 
> AttributeError: 'acq_test_1_cc_sptr' object has no attribute
> 'get_samples_per_second'
> 
> 
> Is there some additional 3.7 swig magic I have to go through
> to make this accessor available from python?

You also need to add the accessor in the include/*.h file as a virtual
member function.

M


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to