On 10/10/14 12:30, Sylvain Munaut wrote:
> Hi,
> 
>> There
>> is way to achieve this without copying around significant portions of code?
> 
> No, you'll need to copy the _impl

Ok. Thanks for confirming my understanding.

I copied the _impl definition, however, I would prefer to do not copy
the interface definition, therefore I defined my block as follows:

namespace gr {
  namespace baz {

    class BAZ_API pll_carriertracking_cc
      : public gr::analog::pll_carriertracking_cc
    {
    public:
      typedef boost::shared_ptr<pll_carriertracking_cc> sptr;
      static sptr make(float loop_bw, float max_freq, float min_freq);
    };

  } // namespace baz
} // namespace gr

Then I copied the definition of the pll_carriertracking_cc_impl class
implementation into my project and changed it where I wanted.

However, in this way, swig is not happy:

 src/gr-baz/swig/baz_swigPYTHON_wrap.cxx: In function 'PyObject*
_wrap_new_pll_carriertracking_cc(PyObject*, PyObject*)':
 /home/manip/src/gr-baz/swig/baz_swigPYTHON_wrap.cxx:11071:87: error:
cannot allocate an object of abstract type 'gr::baz::pll_carriertracking_cc'
        result = (gr::baz::pll_carriertracking_cc *)new
gr::baz::pll_carriertracking_cc();


But if I copy the definition of my block from the GNURadio definition,
swig is happy, the compilation goes fine, and I can correctly use the
block from Python.

What am I doing wrong?  Sorry if this is a trivial C++ error, but my C++
is definitely rusty...

Thanks!

Cheers,
Daniele


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

Reply via email to