Hi Alice - Inside "work" or
"general_work", all you have is access to is pointers to
buffers. The "shape" of them is inferred by the block
implementation specifics, for example a pointer to unsigned char
array, or pointer to float array. Recasting pointers as you
describe will cause a crash, because the std::vector structure
isn't valid. You can, on the other hand, instantiate a
std::vector in the ::work code & provide it with the memory
location of the data & length & that could work. Does
this make sense? If not, maybe read up on the inner working of
GR via some of TomR's presentations from GRCon & elsewhere;
poke through the code in gnuradio-runtime to get an idea of the
GR workings behind the scenes; read up on how C++ classes &
memory allocations work. Doing those sorts of things will
increase your knowledge base & improve how you use GR and
interact with this list. Hope this helps! - MLD
On Wed, Nov 29, 2017, at 11:30 AM, Alice Lo Valvo wrote:
I'm wondering if it is possible
to make an output of a block that is a vector of a vector.
I tried with:
int
vector_source_tagged_impl::work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star
&output_items)
{
std::vector<int>
*optr = (std::vector<int> *) output_items[0];
and there are not compiling
errors, but when I run GRC, it stops with this:
Executing: /usr/bin/python -u
/home/alice/project_GNURADIO/tx_ofdm.py
Using Volk machine:
avx2_64_mmx_orc
>>> Done
Any suggestions?
Thanks in advance.