GNU Radio Manual and C++ API Reference  3.7.5
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
gr::blocks::file_descriptor_source Class Reference

Read stream from file descriptor. More...

#include <gnuradio/blocks/file_descriptor_source.h>

Public Types

typedef boost::shared_ptr
< file_descriptor_source
sptr

Static Public Member Functions

static sptr make (size_t itemsize, int fd, bool repeat=false)

Protected Member Functions

virtual int read_items (char *buf, int nitems)=0
virtual int handle_residue (char *buf, int nbytes_read)=0
virtual void flush_residue ()=0
- Protected Member Functions inherited from gr::sync_block
 sync_block (void)
 sync_block (const std::string &name, gr::io_signature::sptr input_signature, gr::io_signature::sptr output_signature)
- Protected Member Functions inherited from gr::block
 block (void)
 block (const std::string &name, gr::io_signature::sptr input_signature, gr::io_signature::sptr output_signature)
void set_fixed_rate (bool fixed_rate)
void add_item_tag (unsigned int which_output, uint64_t abs_offset, const pmt::pmt_t &key, const pmt::pmt_t &value, const pmt::pmt_t &srcid=pmt::PMT_F)
 Adds a new tag onto the given output buffer.
void add_item_tag (unsigned int which_output, const tag_t &tag)
 Adds a new tag onto the given output buffer.
void remove_item_tag (unsigned int which_input, uint64_t abs_offset, const pmt::pmt_t &key, const pmt::pmt_t &value, const pmt::pmt_t &srcid=pmt::PMT_F)
 Removes a tag from the given input buffer.
void remove_item_tag (unsigned int which_input, const tag_t &tag)
 Removes a tag from the given input buffer.
void get_tags_in_range (std::vector< tag_t > &v, unsigned int which_input, uint64_t abs_start, uint64_t abs_end)
 Given a [start,end), returns a vector of all tags in the range.
void get_tags_in_range (std::vector< tag_t > &v, unsigned int which_input, uint64_t abs_start, uint64_t abs_end, const pmt::pmt_t &key)
 Given a [start,end), returns a vector of all tags in the range with a given key.
void get_tags_in_window (std::vector< tag_t > &v, unsigned int which_input, uint64_t rel_start, uint64_t rel_end)
 Gets all tags within the relative window of the current call to work.
void get_tags_in_window (std::vector< tag_t > &v, unsigned int which_input, uint64_t rel_start, uint64_t rel_end, const pmt::pmt_t &key)
 Operates like gr::block::get_tags_in_window with the ability to only return tags with the specified key.
void enable_update_rate (bool en)
- Protected Member Functions inherited from gr::basic_block
 basic_block (void)
 basic_block (const std::string &name, gr::io_signature::sptr input_signature, gr::io_signature::sptr output_signature)
 Protected constructor prevents instantiation by non-derived classes.
void set_input_signature (gr::io_signature::sptr iosig)
 may only be called during constructor
void set_output_signature (gr::io_signature::sptr iosig)
 may only be called during constructor
void set_color (vcolor color)
 Allow the flowgraph to set for sorting and partitioning.
vcolor color () const
virtual bool has_msg_handler (pmt::pmt_t which_port)
 Tests if there is a handler attached to port which_port.
virtual void dispatch_msg (pmt::pmt_t which_port, pmt::pmt_t msg)

Additional Inherited Members

- Public Member Functions inherited from gr::sync_block
virtual int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)=0
 just like gr::block::general_work, only this arranges to call consume_each for you
void forecast (int noutput_items, gr_vector_int &ninput_items_required)
 Estimate input requirements given output request.
int general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 compute output items from input items
int fixed_rate_ninput_to_noutput (int ninput)
 Given ninput samples, return number of output samples that will be produced. N.B. this is only defined if fixed_rate returns true. Generally speaking, you don't need to override this.
int fixed_rate_noutput_to_ninput (int noutput)
 Given noutput samples, return number of input samples required to produce noutput. N.B. this is only defined if fixed_rate returns true. Generally speaking, you don't need to override this.
- Protected Types inherited from gr::basic_block
enum  vcolor { WHITE, GREY, BLACK }
- Protected Attributes inherited from gr::block
std::vector< long > d_max_output_buffer
std::vector< long > d_min_output_buffer
gr::thread::mutex d_setlock
gr::logger_ptr d_logger
gr::logger_ptr d_debug_logger

Detailed Description

Read stream from file descriptor.

Member Typedef Documentation

Member Function Documentation

virtual void gr::blocks::file_descriptor_source::flush_residue ( )
protectedpure virtual
virtual int gr::blocks::file_descriptor_source::handle_residue ( char *  buf,
int  nbytes_read 
)
protectedpure virtual
static sptr gr::blocks::file_descriptor_source::make ( size_t  itemsize,
int  fd,
bool  repeat = false 
)
static

Build a file descriptor source block. The provided file descriptor will be closed when the sink is destroyed.

Parameters
itemsizeitem size of the incoming data stream.
fdfile descriptor (as an integer).
repeatrepeat the data stream continuously.
virtual int gr::blocks::file_descriptor_source::read_items ( char *  buf,
int  nitems 
)
protectedpure virtual

The documentation for this class was generated from the following file: