[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] adding new code
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] adding new code |
Date: |
Mon, 17 Jan 2005 14:40:45 -0800 |
User-agent: |
Mutt/1.5.6i |
On Mon, Jan 17, 2005 at 02:39:38PM -0600, Suvda Myagmar wrote:
> I would like to my own code to gnuradio core library. A different
> version of gr_buffer class, say files gr_mybuffer.cc and
> gr_mybuffer.h. I would like to be able to use this new class when
> allocating buffers in flow_graph.py, code line:
>
> from gnuradio_swig_python import buffer, buffer_add_reader,
> block_detail, \
> single_threaded_scheduler
> ....
> return buffer (nitems, item_size)
>
> How do I go about it?
> How gr_buffer class relate to python class
> 'buffer'? How I do make this connection?
The python gr.buffer object is just a swig generated wrapper around
the gr_buffer C++ class. The swig interface file is gr_buffer.i
See the docs at www.swig.org
> To compile the new code, I just need to change the Makefile in the
> gnuradio-core-2.x/src/lib/runtime and compile? Do I need to have the
> gnuradio CVS code?
> Thanks
You don't have to work with the CVS build, but given what you're
trying to do I think it would be a good idea.
Most of the methods of gr_buffer are not virtual, so just subclassing
it probably won't get you what you want. The rest of the C++ part of
the system will use the base class methods (most of which are inlined
for performance).
Assuming that your strategy is to create a new implementation of
gr_buffer, the easiest way would be to create the gr_mybuffer.{h,cc,i}
files, and make sure that the classes defined by them are called
gr_buffer and gr_buffer_reader. Then edit
gnuradio-core/src/lib/runtime/Makefile.am replacing the references to
gr_buffer.{h,cc,i} with gr_mybuffer.{h,cc,i} and follow the directions
in the top level README for a CVS build. When configuring be sure to
use the --enable-maintainer-mode option or else the Makefile
generation rules aren't enabled.
If you haven't already, I suggest you get the CVS code to build on
your system.
Eric