GNU Radio 3.7.3 C++ API
gr::buffer_reader Class Reference

How we keep track of the readers of a gr::buffer. More...

#include <gnuradio/buffer.h>

Public Member Functions

 ~buffer_reader ()
 
void declare_sample_delay (unsigned delay)
 
unsigned sample_delay () const
 
int items_available () const
 Return number of items available for reading. More...
 
buffer_sptr buffer () const
 Return buffer this reader reads from. More...
 
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. More...
 
const voidread_pointer ()
 return pointer to read buffer. More...
 
void update_read_pointer (int nitems)
 
void set_done (bool done)
 
bool done () const
 
gr::thread::mutexmutex ()
 
uint64_t nitems_read ()
 
size_t get_sizeof_item ()
 
block_sptr link ()
 Return the block that reads via this reader. More...
 
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. More...
 

Friends

class buffer
 
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. More...
 

Detailed Description

How we keep track of the readers of a gr::buffer.

Constructor & Destructor Documentation

gr::buffer_reader::~buffer_reader ( )

Member Function Documentation

buffer_sptr gr::buffer_reader::buffer ( ) const
inline

Return buffer this reader reads from.

void gr::buffer_reader::declare_sample_delay ( unsigned  delay)

Declares the sample delay for this reader.

See gr::block::declare_sample_delay for details.

Parameters
delayThe new sample delay
bool gr::buffer_reader::done ( ) const
inline
size_t gr::buffer_reader::get_sizeof_item ( )
inline
void gr::buffer_reader::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.

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
idthe unique ID of the block to make sure already deleted tags are not returned
int gr::buffer_reader::items_available ( ) const

Return number of items available for reading.

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.

gr::thread::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

unsigned gr::buffer_reader::sample_delay ( ) const

Gets the sample delay for this reader.

See gr::block::sample_delay for details.

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 buffer
friend
GR_RUNTIME_API buffer_reader_sptr buffer_add_reader ( buffer_sptr  buf,
int  nzero_preload,
block_sptr  link,
int  delay 
)
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.
delayOptional setting to declare the buffer's sample delay.

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