Reuse c++ modules in c++ code

Hi,
I am writing a new c++ signal processing block and wondering if I can
use existing gnuradio modules in this new module. I know reuse c++
modules in python is easy via swig. When it comes to reusing in c++,
what is the best way? I can think of inheritance. But what if I want to
use multiple existing modules? Maybe I should use composition, and in my
work(), I should call work() of all embeded modules?
Regards
Kyle

On Mon, Apr 12, 2010 at 17:31, Kyle Z. [email protected] wrote:

I am writing a new c++ signal processing block and wondering if I can use
existing gnuradio modules in this new module. I know reuse c++ modules in
python is easy via swig. When it comes to reusing in c++, what is the best
way? I can think of inheritance. But what if I want to use multiple existing
modules?

It is possible to write hierarchical blocks in C++, which compose
existing blocks into an internal flowgraph:

http://gnuradio.org/redmine/repositories/browse/gnuradio/gnuradio-core/src/lib/hier

You do not need to call the work() function of the internal blocks;
the runtime figures all this out for you.

Johnathan