11 #ifndef INCLUDED_GR_RUNTIME_BUFFER_SINGLE_MAPPED_H
12 #define INCLUDED_GR_RUNTIME_BUFFER_SINGLE_MAPPED_H
61 unsigned read_index)
override = 0;
95 assert(s < d_bufsize);
107 assert((
unsigned)s < d_bufsize);
116 uint64_t downstream_lcm_nitems,
118 block_sptr buf_owner);
145 uint64_t downstream_lcm_nitems,
146 uint32_t downstream_max_out_mult,
148 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:30
unsigned index_sub(unsigned a, unsigned b) override
Decrement read or write index for this buffer.
Definition: buffer_single_mapped.h:99
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:120
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:122
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:32
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:88
block_sptr buf_owner()
Return the block that owns this buffer.
Definition: buffer_single_mapped.h:40
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:33
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:250