cbuffercf

Circular buffer object for storing and retrieving samples in a first-in/first-out (FIFO) manner using a minimal amount of memory

Variants: cbuffercf, cbufferf

Public Functions

cbuffercf cbuffercf_create(unsigned int _max_size)
cbuffercf cbuffercf_create_max(unsigned int _max_size, unsigned int _max_read)
cbuffercf cbuffercf_copy(cbuffercf _q)
int cbuffercf_destroy(cbuffercf _q)
int cbuffercf_print(cbuffercf _q)
int cbuffercf_debug_print(cbuffercf _q)
int cbuffercf_reset(cbuffercf _q)
unsigned int cbuffercf_size(cbuffercf _q)
unsigned int cbuffercf_max_size(cbuffercf _q)
unsigned int cbuffercf_max_read(cbuffercf _q)
unsigned int cbuffercf_space_available(cbuffercf _q)
int cbuffercf_is_empty(cbuffercf _q)
int cbuffercf_is_full(cbuffercf _q)
int cbuffercf_push(cbuffercf _q, float complex _v)
int cbuffercf_write(cbuffercf _q, float complex * _v, unsigned int _n)
int cbuffercf_pop(cbuffercf _q, float complex * _v)
int cbuffercf_read(cbuffercf _q, unsigned int _num_requested, float complex ** _v, unsigned int * _num_read)
int cbuffercf_release(cbuffercf _q, unsigned int _n)

Interfaces

cbuffercf cbuffercf_create(unsigned int _max_size)

Create circular buffer object of a particular maximum storage length

  • _max_size : maximum buffer size, 0 < _max_size

cbuffercf cbuffercf_create_max(unsigned int _max_size, unsigned int _max_read)

Create circular buffer object of a particular maximum storage size and specify the maximum number of elements that can be read at any any given time

  • _max_size : maximum buffer size, 0 < _max_size
  • _max_read : maximum size that will be read from buffer

cbuffercf cbuffercf_copy(cbuffercf _q)

Copy object including all internal objects and state

int cbuffercf_destroy(cbuffercf _q)

Destroy cbuffer object, freeing all internal memory

int cbuffercf_print(cbuffercf _q)

Print cbuffer object properties to stdout

int cbuffercf_debug_print(cbuffercf _q)

Print cbuffer object properties and internal state

int cbuffercf_reset(cbuffercf _q)

Clear internal buffer

unsigned int cbuffercf_size(cbuffercf _q)

Get the number of elements currently in the buffer

unsigned int cbuffercf_max_size(cbuffercf _q)

Get the maximum number of elements the buffer can hold

unsigned int cbuffercf_max_read(cbuffercf _q)

Get the maximum number of elements you may read at once

unsigned int cbuffercf_space_available(cbuffercf _q)

Get the number of available slots (max_size - size)

int cbuffercf_is_empty(cbuffercf _q)

Return flag indicating if the buffer is empty or not

int cbuffercf_is_full(cbuffercf _q)

Return flag indicating if the buffer is full or not

int cbuffercf_push(cbuffercf _q, float complex _v)

Write a single sample into the buffer

  • _q : circular buffer object
  • _v : input sample

int cbuffercf_write(cbuffercf _q, float complex * _v, unsigned int _n)

Write a block of samples to the buffer

  • _q : circular buffer object
  • _v : array of samples to write to buffer
  • _n : number of samples to write

int cbuffercf_pop(cbuffercf _q, float complex * _v)

Remove and return a single element from the buffer by setting the value of the output sample pointed to by _v

  • _q : circular buffer object
  • _v : pointer to sample output

int cbuffercf_read(cbuffercf _q, unsigned int _num_requested, float complex ** _v, unsigned int * _num_read)

Read buffer contents by returning a pointer to the linearized array; note that the returned pointer is only valid until another operation is performed on the circular buffer object

  • _q : circular buffer object
  • _num_requested : number of elements requested
  • _v : output pointer
  • _num_read : number of elements referenced by _v

int cbuffercf_release(cbuffercf _q, unsigned int _n)

Release _n samples from the buffer

  • _q : circular buffer object
  • _n : number of elements to release