Passing vectors as PMT

Hi,

I’m passing the content of a std::vector as a pmt. Question is, do I do
it as a blob, or do I set up a pmt vector? The latter seems safer, and
easier accessible in Python, but it’s also more complicated (as I can’t
create pmt vectors directly from std::vectors).

Has anyone done this, and have any suggestions?

MB


Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association

On 12/23/2012 03:34 PM, Martin B. (CEL) wrote:

Hi,

I’m passing the content of a std::vector as a pmt. Question is, do
I do it as a blob, or do I set up a pmt vector? The latter seems
safer, and easier accessible in Python, but it’s also more
complicated (as I can’t create pmt vectors directly from
std::vectors).

Has anyone done this, and have any suggestions?

try make_blob(&vec.front(), num_bytes);

It makes a copy of whatever pointer you pass into it.

-josh