GNU Radio 3.4.0 C++ API
gr_buffer_reader Class Reference

How we keep track of the readers of a gr_buffer. More...

#include <gr_buffer.h>

List of all members.

Public Member Functions

 ~gr_buffer_reader ()
int items_available () const
 Return number of items available for reading.
gr_buffer_sptr buffer () const
 Return buffer this reader reads from.
int max_possible_items_available () const
 Return maximum number of items that could ever be available for reading. This is used as a sanity check in the scheduler to avoid looping forever.
const void * read_pointer ()
 return pointer to read buffer.
void update_read_pointer (int nitems)
void set_done (bool done)
bool done () const
gruel::mutex * mutex ()
uint64_t nitems_read ()
gr_block_sptr link ()
 Return the block that reads via this reader.
void get_tags_in_range (std::vector< pmt::pmt_t > &v, uint64_t abs_start, uint64_t abs_end)
 Given a [start,end), returns a vector all tags in the range.

Friends

class gr_buffer
gr_buffer_reader_sptr gr_buffer_add_reader (gr_buffer_sptr buf, int nzero_preload, gr_block_sptr link)
 Create a new gr_buffer_reader and attach it to buffer buf.

Detailed Description

How we keep track of the readers of a gr_buffer.


Constructor & Destructor Documentation

gr_buffer_reader::~gr_buffer_reader ( )

Member Function Documentation

gr_buffer_sptr gr_buffer_reader::buffer ( ) const [inline]

Return buffer this reader reads from.

bool gr_buffer_reader::done ( ) const [inline]
void gr_buffer_reader::get_tags_in_range ( std::vector< pmt::pmt_t > &  v,
uint64_t  abs_start,
uint64_t  abs_end 
)

Given a [start,end), returns a vector all tags in the range.

Get a vector of tags in given range. Range of counts is from start to end-1.

Tags are tuples of: (item count, source id, key, value)

Parameters:
va vector reference to return tags into
abs_starta uint64 count of the start of the range of interest
abs_enda uint64 count of the end of the range of interest
int gr_buffer_reader::items_available ( ) const

Return number of items available for reading.

gr_block_sptr gr_buffer_reader::link ( ) [inline]

Return the block that reads via this reader.

int gr_buffer_reader::max_possible_items_available ( ) const [inline]

Return maximum number of items that could ever be available for reading. This is used as a sanity check in the scheduler to avoid looping forever.

gruel::mutex* gr_buffer_reader::mutex ( ) [inline]
uint64_t gr_buffer_reader::nitems_read ( ) [inline]
const void* gr_buffer_reader::read_pointer ( )

return pointer to read buffer.

The return value points to items_available() number of items

void gr_buffer_reader::set_done ( bool  done) [inline]
void gr_buffer_reader::update_read_pointer ( int  nitems)

Friends And Related Function Documentation

friend class gr_buffer [friend]
gr_buffer_reader_sptr gr_buffer_add_reader ( gr_buffer_sptr  buf,
int  nzero_preload,
gr_block_sptr  link 
) [friend]

Create a new gr_buffer_reader and attach it to buffer buf.

Parameters:
bufis the buffer the gr_buffer_reader reads from.
nzero_preload-- number of zero items to "preload" into buffer.
linkis the block that reads from the buffer using this gr_buffer_reader.

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