discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Re: one question about gr_chunks_to_symbols_bc


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Re: one question about gr_chunks_to_symbols_bc
Date: Sun, 21 Sep 2008 10:27:12 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

On Sun, Sep 21, 2008 at 11:56:08AM -0500, jiangfan shi wrote:
> Thanks, Eric.
> 
> >> >  for (int m=0;m<nstreams;m++) {
> >> >    const unsigned char *in = (unsigned char *) input_items[m];
> 
> Maybe I do not express my questions clearly. Basically I am asking
> what the above code statement means. My understanding is that the
> input_items is a 2-dimension array.

input_items is of type gr_vector_const_void_star.

Searching for the definition of gr_vector_const_void_star reveals it's
a typedef living in gr_types.h:

  typedef std::vector<const void *>             gr_vector_const_void_star;

Thus, it's not a 2-dimensional array, but rather an STL vector of void *.

The void*'s point into memory allocated by the system that holds the
input data for the block.

Please see 
  http://www.gnu.org/software/gnuradio/doc/howto-write-a-block.html
for additional information.


The following lines cast the void * to a type that matches the actual
type of the input.  In this case it's unsigned char.

> >> >  for (int m=0;m<nstreams;m++) {
> >> >    const unsigned char *in = (unsigned char *) input_items[m];


If any of this is still not clear, you may want to refer to a good C++
and/or STL introduction.

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]