11#ifndef INCLUDED_GR_RUNTIME_BUFFER_READER_H
12#define INCLUDED_GR_RUNTIME_BUFFER_READER_H
24class buffer_reader_sm;
35 block_sptr link = block_sptr(),
82 buffer_sptr
buffer()
const {
return d_buffer; }
102 void set_done(
bool done) { d_buffer->set_done(done); }
103 bool done()
const {
return d_buffer->done(); }
112 d_abs_read_offset = 0;
121 block_sptr
link()
const {
return block_sptr(d_link); }
Single writer, multiple reader fifo.
Definition: buffer_double_mapped.h:29
Definition: buffer_reader_sm.h:22
How we keep track of the readers of a gr::buffer.
Definition: buffer_reader.h:49
uint64_t nitems_read() const
Definition: buffer_reader.h:107
unsigned sample_delay() const
unsigned int get_read_index() const
Definition: buffer_reader.h:161
uint64_t d_abs_read_offset
Definition: buffer_reader.h:177
std::weak_ptr< block > d_link
Definition: buffer_reader.h:178
block_sptr link() const
Return the block that reads via this reader.
Definition: buffer_reader.h:121
const void * read_pointer()
return pointer to read buffer.
buffer_sptr d_buffer
Definition: buffer_reader.h:175
size_t get_sizeof_item()
Definition: buffer_reader.h:115
void set_done(bool done)
Definition: buffer_reader.h:102
virtual int items_available() const
Return number of items available for reading.
void declare_sample_delay(unsigned delay)
bool done() const
Definition: buffer_reader.h:103
buffer_sptr buffer() const
Return buffer this reader reads from.
Definition: buffer_reader.h:82
uint64_t get_abs_read_offset() const
Definition: buffer_reader.h:162
void get_tags_in_range(std::vector< tag_t > &v, uint64_t abs_start, uint64_t abs_end, long id)
Given a [start,end), returns a vector all tags in the range.
unsigned d_attr_delay
Definition: buffer_reader.h:179
unsigned int d_read_index
Definition: buffer_reader.h:176
void update_read_pointer(int nitems)
buffer_reader(buffer_sptr buffer, unsigned int read_index, block_sptr link)
constructor is private. Use gr::buffer::add_reader to create instances
gr::thread::mutex * mutex()
Definition: buffer_reader.h:105
friend GR_RUNTIME_API buffer_reader_sptr buffer_add_reader(buffer_sptr buf, int nzero_preload, block_sptr link, int delay)
Create a new gr::buffer_reader and attach it to buffer buf.
void reset_nitem_counter()
Definition: buffer_reader.h:109
virtual bool input_blkd_cb_ready(int items_required) const
Returns true when the current thread is ready to call the callback, false otherwise....
Definition: buffer_reader.h:148
int max_possible_items_available() const
Return maximum number of items that could ever be available for reading. This is used as a sanity che...
Definition: buffer_reader.h:88
virtual bool input_blocked_callback(int items_required, int items_avail)
Callback function that the scheduler will call when it determines that the input is blocked....
Definition: buffer_reader.h:155
A single mapped buffer where wrapping conditions are handled explicitly via input/output_blocked_call...
Definition: buffer_single_mapped.h:31
Single writer, multiple reader fifo.
Definition: buffer.h:67
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:18
boost::mutex mutex
Definition: thread.h:37
GNU Radio logging wrapper.
Definition: basic_block.h:29
std::shared_ptr< logger > logger_ptr
Definition: logger.h:225
GR_RUNTIME_API long buffer_reader_ncurrently_allocated()
returns # of buffer_readers currently allocated
GR_RUNTIME_API buffer_reader_sptr buffer_add_reader(buffer_sptr buf, int nzero_preload, block_sptr link=block_sptr(), int delay=0)
Create a new gr::buffer_reader and attach it to buffer buf.
GR_RUNTIME_API long buffer_ncurrently_allocated()
returns # of buffers currently allocated
Definition: cc_common.h:35