Hi all,

Sorry to bother again with this issue. Maybe the question is:

Can I pass a pointer as an argument to the block function?. I mean, can I
use the block like this:

blob_to_stream_impl(const size_t *file) // Pass a pointer to the blob
function.

Regards,

Jose

On Wed, Oct 3, 2012 at 4:12 PM, Jose Torres Diaz
<torresdiaz.j...@gmail.com>wrote:

> In order to add extra information,
>
> I know that block() contains a pure virtual function, so that, in the
> blob_to_stream program it is used:
>
> _item_size(item_size). Then, _item_size is the object used in
> blob_to_stream.
>
> However, I am still wondering if a received a pointer, how can I
> manipulate it?.
>
> The error is all the time:
>
> cannot allocate an object of abstract type 'asrp_fec_encoder'
> because the following virtual functions are pure within 'asrp_fec_encoder':
> /usr/local/include/gnuradio/block.h:236:17: note:     virtual int
> gnuradio::block::work(const InputItems&, const OutputItems&)
> asrp_fec_encoder.cc: In constructor
> 'asrp_fec_encoder::asrp_fec_encoder(const char*)':
>
>
> Regards,
>
> Jose
>
>
>
>
> On Wed, Oct 3, 2012 at 3:03 PM, Jose Torres Diaz <
> torresdiaz.j...@gmail.com> wrote:
>
>> Hi,
>>
>> I'm modifying the block BLOB_TO_STREAM and I would like to pass a pointer
>> to that function. The original file (blob_to_stream.cc) is like this:
>>
>> class blob_to_stream_impl : public blob_to_stream{
>> public:
>>     blob_to_stream_impl(const size_t item_size):
>>         block(
>>             "blob_to_stream",
>>             gr_make_io_signature(0, 0, 0),
>>             gr_make_io_signature(1, 1, item_size),
>>             msg_signature(true, 0)
>>         ),
>>         _item_size(item_size)
>>     {
>>         _offset = 0;
>>     }
>>
>> //Work function here
>>
>> private:
>>     const size_t _item_size;
>>     gr_tag_t _msg;
>>     size_t _offset;
>> };
>>
>> My new version, it will be something like this:
>>
>> class blob_to_stream_impl : public blob_to_stream{
>> public:
>>     blob_to_stream_impl(const size_t *file):
>>         block(
>>             "blob_to_stream",
>>             gr_make_io_signature(0, 0, 0),
>>             gr_make_io_signature(1, 1, item_size),
>>             msg_signature(true, 0)
>>         ),
>>
>>     {
>>         _offset = 0;
>>     }
>>
>> But my question is, how can I initialize the pointer *file here?. I tried
>> different methods, but I always get an error.
>>
>> Any comment will be highly appreciate it,
>>
>> Cheers,
>>
>> Jose
>>
>
>
>
>
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to