GNU Radio 2.x: gr_buffer Class Reference

Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

# gr_buffer Class Reference
[Implementation Details]

`#include <gr_buffer.h>`

Collaboration diagram for gr_buffer:

[legend]
List of all members.

## Detailed Description

Single writer, multiple reader fifo.

## Public Member Functions
virtual | ~gr_buffer ()
int | space_available () const
| return number of items worth of space available for writing
void * | write_pointer ()
| return pointer to write buffer.
void | update_write_pointer (int nitems)
| tell buffer that we wrote `nitems` into it
void | set_done (bool done)
bool | done () const
## Protected Attributes
char * | d_base
unsigned int | d_bufsize
## Friends
class | gr_buffer_reader
gr_buffer_sptr | gr_make_buffer (int nitems, size_t sizeof_item)
| Allocate a buffer that holds at least `nitems` of size `sizeof_item`.
gr_buffer_reader_sptr | gr_buffer_add_reader (gr_buffer_sptr buf, int history)
| create a new gr_buffer_reader and attach it to buffer `buf`

## Constructor & Destructor Documentation

gr_buffer::~gr_buffer | ( |  | ) | `[virtual]`

## Member Function Documentation

bool gr_buffer::done | ( |  | ) | const`[inline]`

void gr_buffer::set_done | ( | bool | done | ) | `[inline]`

int gr_buffer::space_available | ( |  | ) | const

| return number of items worth of space available for writing

void gr_buffer::update_write_pointer | ( | int | nitems | ) |

| tell buffer that we wrote `nitems` into it

void * gr_buffer::write_pointer | ( |  | ) |

| return pointer to write buffer. The return value points at space that can hold at least space_available() items.

## Friends And Related Function Documentation

gr_buffer_reader_sptr gr_buffer_add_reader | ( | gr_buffer_sptr | buf,
|  | int | history
| ) | `[friend]`

| create a new gr_buffer_reader and attach it to buffer `buf`

friend class gr_buffer_reader`[friend]`

gr_buffer_sptr gr_make_buffer | ( | int | nitems,
|  | size_t | sizeof_item
| ) | `[friend]`

| Allocate a buffer that holds at least `nitems` of size `sizeof_item`. The total size of the buffer will be rounded up to a system dependent boundary. This is typically the system page size, but under MS windows is 64KB.

## Member Data Documentation

char* gr_buffer::d_base`[protected]`

unsigned int gr_buffer::d_bufsize`[protected]`

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

- gr_buffer.h
- gr_buffer.cc