discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Extending a GNU Radio block with use of inheritance


From: Piotr Krysik
Subject: [Discuss-gnuradio] Extending a GNU Radio block with use of inheritance
Date: Wed, 1 Jun 2016 20:45:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0

Hi all,

I want to extend a little general_work function of one of the blocks
(fractional_resampler) in order to add processing of stream tags that
will change parameters of the block instance (i.e. call function set_mu)
at a moment marked by a stream tag.

Probably the optimal solution in terms of code reuse would be to extend
the block with use of inheritance. In this case general_work function of
the base class would be called by general_work function of the derived
class.

However, I don't know how to do it. Inheriting from the class available
in the installed header (fractional_resampler_cc.h) is not a good
solution as it is an abstract class, so I would have to re-implement
(copy) all of the blocks' functions.

Is it possible to do what I want with use of inheritance? If yes - how
to do it so I wouldn't have to copy the code?

(Extending fractional_resampler_cc is just an example - there are more
blocks that I would like to modify without having to copy all of the code).

Best Regards,
Piotr Krysik



reply via email to

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