On Wed, Apr 14, 2010 at 09:56:48AM -0400, Tom Rondeau wrote:
> On Wed, Apr 14, 2010 at 2:15 AM, Mir M. Ali <mirmurt...@gmail.com> wrote:
> > Hi,
> > I have a Gnuradio block that i built in C++ that has a vector passed to it.
> > When I want to import the python equivalent of that block in python how will
> > i pass a vector to it. I thought lists were an equivalent but it doesn't
> > work.
> >
> > Thanks
> > Mir
> 
> Python tuples and lists can be passed as std::vector<X> to the C++
> block.

We pass 

  const std::vector<foo> &bar

which semantically allows a copy to be made of the data (a copy from a
python representation to the C++ representation).

If you use

  std::vector<foo> &bar

The copy cannot be made (since changes to bar would need to be
reflected back into python).


> You can look in gr_ofdm_mapper_bcv to see one example of how we
> did this. More complicated, look at gr_ofdm_insert_preamble where we
> pass in a vector of vectors. It's possibly a problem with your swig
> interface file.
> 
> Tom

Eric


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

Reply via email to