discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Initialize a pointer - object


From: Jose Torres Diaz
Subject: Re: [Discuss-gnuradio] Initialize a pointer - object
Date: Wed, 3 Oct 2012 16:12:44 +0930

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 <address@hidden> 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




reply via email to

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