Re: [Discuss-gnuradio] reuse c++ modules in c++ code

2010-04-13 Thread Johnathan Corgan
On Mon, Apr 12, 2010 at 17:31, Kyle Zhou  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


___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] reuse c++ modules in c++ code

2010-04-12 Thread Kyle Zhou

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



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio