discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Sub-classing a block defined in an _impl class


From: Daniele Nicolodi
Subject: Re: [Discuss-gnuradio] Sub-classing a block defined in an _impl class
Date: Fri, 10 Oct 2014 15:24:22 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.1.2

On 10/10/14 14:29, Daniele Nicolodi wrote:
> 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:

It seems to be a limitation of SWIG (which I don't know much, so I may
still be doing something wrong). If I define a virtual method in the
definition of my block interface, SWIG generates the correct C++ code.

I ended up adding a definition for the work() virtual method to fix the
issue. Again, not the most elegant thing to do, but it works...

Cheers,
Daniele




reply via email to

[Prev in Thread] Current Thread [Next in Thread]