11#ifndef INCLUDED_GR_RUNTIME_BUFFER_SINGLE_MAPPED_H
12#define INCLUDED_GR_RUNTIME_BUFFER_SINGLE_MAPPED_H
62 unsigned read_index)
override = 0;
96 assert(s < d_bufsize);
108 assert((
unsigned)s < d_bufsize);
117 uint64_t downstream_lcm_nitems,
119 block_sptr buf_owner);
146 uint64_t downstream_lcm_nitems,
147 uint32_t downstream_max_out_mult,
149 block_sptr buf_owner);
How we keep track of the readers of a gr::buffer.
Definition: buffer_reader.h:49
A single mapped buffer where wrapping conditions are handled explicitly via input/output_blocked_call...
Definition: buffer_single_mapped.h:31
unsigned index_sub(unsigned a, unsigned b) override
Decrement read or write index for this buffer.
Definition: buffer_single_mapped.h:100
bool input_blocked_callback(int items_required, int items_avail, unsigned read_index) override=0
Callback function that the scheduler will call when it determines that the input is blocked....
~buffer_single_mapped() override
bool allocate_buffer(int nitems) override
Make reasonable attempt to adjust nitems based on read/write granularity then delegate actual allocat...
block_sptr d_buf_owner
Definition: buffer_single_mapped.h:121
friend GR_RUNTIME_API buffer_sptr make_buffer(int nitems, size_t sizeof_item, uint64_t downstream_lcm_nitems, block_sptr link, block_sptr buf_owner)
buffer_single_mapped(int nitems, size_t sizeof_item, uint64_t downstream_lcm_nitems, uint32_t downstream_max_out_mult, block_sptr link, block_sptr buf_owner)
constructor is private. Use gr_make_buffer to create instances.
bool output_blkd_cb_ready(int output_multiple) override
Return true if thread is ready to call the callback, false otherwise.
bool input_blkd_cb_ready(int items_required, unsigned read_index) override
Return true if thread is ready to call input_blocked_callback, false otherwise.
std::unique_ptr< char[]> d_buffer
Definition: buffer_single_mapped.h:123
virtual bool input_blocked_callback_logic(int items_required, int items_avail, unsigned read_index, char *buffer_ptr, mem_func_t const &memcpy_func, mem_func_t const &memmove_func)
Abstracted logic for the input blocked callback function.
gr::logger_ptr d_logger
Definition: buffer_single_mapped.h:33
bool output_blocked_callback(int output_multiple, bool force) override=0
Callback function that the scheduler will call when it determines that the output is blocked.
void update_reader_block_history(unsigned history, int delay) override
unsigned index_add(unsigned a, unsigned b) override
Increment read or write index for this buffer.
Definition: buffer_single_mapped.h:89
block_sptr buf_owner()
Return the block that owns this buffer.
Definition: buffer_single_mapped.h:41
int space_available() override
return number of items worth of space available for writing
virtual bool do_allocate_buffer(size_t final_nitems, size_t sizeof_item)=0
Do actual buffer allocation. This is intended (required) to be handled by the derived class.
virtual bool output_blocked_callback_logic(int output_multiple, bool force, char *buffer_ptr, mem_func_t const &memmove_func)
Abstracted logic for the output blocked callback function.
gr::logger_ptr d_debug_logger
Definition: buffer_single_mapped.h:34
Single writer, multiple reader fifo.
Definition: buffer.h:67
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29
std::function< void *(void *, const void *, std::size_t)> mem_func_t
Definition: buffer.h:36
std::shared_ptr< logger > logger_ptr
Definition: logger.h:225