discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Code re-use in blocks / C++ inheritance with gr::


From: Sylvain Munaut
Subject: Re: [Discuss-gnuradio] Code re-use in blocks / C++ inheritance with gr::sync_block
Date: Tue, 22 Oct 2013 13:40:21 +0200

Hi Marcus,

> If you correctly called the chain of superconstructors, that shouldn't
> happen if you correctly set your io_signatures.

Yup, that was the issue.

I was defining the call to gr::sync_block constructor as part of the
base_sink_c_impl class constructor since it seemed the most logical
place for it to be.
But given the virtual inheritance , I can only define it as part of
glfw_sink_c_impl constructor and without this, the default constructor
was called (which sets neither the name nor the io signature).

Now, it works as intended :)


>> The problem I have with this is that I must expose a bunch of stuff in
>> the public header that I don't want to.
>> base_sink_c_impl has plenty of private method and members, none of
>> which the "user" should see (ie. not be installed in the public
>> headers)
>
> I think that's the point of private and protected members, you shouldn't
> have to go to the total extreme of hiding everything away in an impl, if you
> plan to inherit from that impl later....

Well it's mostly because the private part include plenty of other
headers to define structures and objects that shouldn't be part of the
ABI.


Cheers and thanks for pointing me in the right direction :)

    Sylvain



reply via email to

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