dxd - dynax driver framework  2675
cross platform open source driver development framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dx::circular Struct Reference

kernel/user space shared circular buffer More...

#include <dx_stream.h>

Public Member Functions

uint64_t empty ()
 
uint64_t empty (volatile uint64_t &position)
 
void flush ()
 
template<typename circular_t , typename ext_t >
bool force_write (volatile uint64_t &position, const ext_t *const *src, uint64_t bulk, unsigned int channels_circular=1, unsigned int channels_src=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 multi channel interleaved bulk write into circular buffer with format conversion if applicable More...
 
template<typename circular_t , typename ext_t >
bool force_write (const ext_t *const *src, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int channels_src=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename circular_t , typename ext_t >
bool force_write (volatile uint64_t &position, const ext_t *src, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 single channel More...
 
template<typename circular_t , typename ext_t >
bool force_write (const ext_t *src, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename data_t >
bool force_write (volatile uint64_t &position, const data_t *src, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 single channel circular_t==ext_t More...
 
template<typename data_t >
bool force_write (const data_t *src, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename data_t >
bool force_write (const data_t *const *src, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int channels_src=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 multi channel circular_t==ext_t More...
 
template<typename circular_t , typename src_t >
bool force_write (src_t *const *const *src, unsigned int clients, unsigned int channels=1, uint64_t bulk=1)
 multi channel multi client bulk mix into circular buffer with format conversion if applicable src[client][channel][sample] More...
 
template<typename data_t >
bool force_write (data_t *const *const *src, uint64_t clients, uint64_t channels, uint64_t bulk)
 
void initialize (uint64_t backingstore_size)
 
void initialize ()
 
uint64_t loop () const
 
template<typename exception_t , typename callback_t >
void move (callback_t &callback, uint64_t max) throw (exception_t)
 
template<typename data_t >
bool operator<< (const data_t &src)
 
template<typename data_t >
bool operator>> (data_t &dst)
 
template<typename circular_t , typename ext_t >
bool read (volatile uint64_t &position, ext_t *const *dst, uint64_t bulk, unsigned int channels_circular=1, unsigned int channels_dst=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 multi channel interleaved bulk read from circular buffer with format conversion if applicable More...
 
template<typename circular_t , typename ext_t >
bool read (ext_t *const *dst, uint64_t bulk, unsigned int channels_circular=1, unsigned int channels_dst=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename circular_t , typename ext_t >
bool read (volatile uint64_t &position, ext_t *dst, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename circular_t , typename ext_t >
bool read (ext_t *dst, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename data_t >
bool read (volatile uint64_t &position, data_t *dst, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename data_t >
bool read (data_t *dst, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename data_t >
bool read (data_t *const *dst, uint64_t bulk, unsigned int channels_circular=1, unsigned int channels_dst=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename data_t >
bool read (volatile uint64_t &position, data_t *const *dst, uint64_t bulk, unsigned int channels_circular=1, unsigned int channels_dst=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename dst_t = char>
dst_t * simulate_read (volatile uint64_t &position, uint64_t bulk=1)
 
template<typename dst_t = char>
dst_t * simulate_read (uint64_t bulk=1)
 
char * simulate_write (uint64_t bulk)
 simulate write by advancing write idx and take care of wrap write optimization More...
 
uint64_t used ()
 
uint64_t used (volatile uint64_t &position)
 
template<typename circular_t , typename ext_t >
bool write (volatile uint64_t &position, const ext_t *const *src, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int channels_src=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 bulk write into circular buffer with format conversion if applicable More...
 
template<typename circular_t , typename ext_t >
bool write (const ext_t *const *src, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int channels_src=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename circular_t , typename ext_t >
bool write (volatile uint64_t &position, const ext_t *src, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename circular_t , typename ext_t >
bool write (const ext_t *src, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename data_t >
bool write (volatile uint64_t &position, const data_t *src, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename data_t >
bool write (const data_t *src, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 
template<typename data_t >
bool write (const data_t *const *src, uint64_t bulk=1, unsigned int channels_circular=1, unsigned int channels_src=1, unsigned int circular_offset=0, unsigned int interleaved=1)
 

Public Attributes

char data [1]
 
volatile uint64_t dropout
 drop out counter More...
 
volatile uint64_t rx
 single consumers current read index More...
 
uint64_t size
 size of buffer in bytes More...
 
volatile int64_t timestamp
 current rx/tx timestamp More...
 
volatile uint64_t tx
 producers current write index More...
 
struct {
   volatile uint64_t   count
 buffer wrap count More...
 
   volatile int64_t   timestamp
 timestamp of last buffer wrap More...
 
zero
 

Detailed Description

kernel/user space shared circular buffer

this buffer is non-blocking for single-consumer/single-producer configurations; multiple producer write interleaved while obtaining shadow.tx; if shadow.tx==tx the producer is allowed to write into the buffer after advancing shadow.tx to the final tx position; once tx reaches shadow.tx the write is terminated and the producer can start a write cycle. multiple consumer each hold there own rx and read between rx and cycle.tx.

Member Function Documentation

uint64_t dx::circular::empty ( )
inline

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint64_t dx::circular::empty ( volatile uint64_t position)
inline
void dx::circular::flush ( )
inline

+ Here is the caller graph for this function:

template<typename circular_t , typename ext_t >
bool dx::circular::force_write ( volatile uint64_t position,
const ext_t *const *  src,
uint64_t  bulk,
unsigned int  channels_circular = 1,
unsigned int  channels_src = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline

multi channel interleaved bulk write into circular buffer with format conversion if applicable

return true if data fit into circular space

+ Here is the caller graph for this function:

template<typename circular_t , typename ext_t >
bool dx::circular::force_write ( const ext_t *const *  src,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  channels_src = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline
template<typename circular_t , typename ext_t >
bool dx::circular::force_write ( volatile uint64_t position,
const ext_t *  src,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline

single channel

template<typename circular_t , typename ext_t >
bool dx::circular::force_write ( const ext_t *  src,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline
template<typename data_t >
bool dx::circular::force_write ( volatile uint64_t position,
const data_t *  src,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline

single channel circular_t==ext_t

template<typename data_t >
bool dx::circular::force_write ( const data_t *  src,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline
template<typename data_t >
bool dx::circular::force_write ( const data_t *const *  src,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  channels_src = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline

multi channel circular_t==ext_t

template<typename circular_t , typename src_t >
bool dx::circular::force_write ( src_t *const *const *  src,
unsigned int  clients,
unsigned int  channels = 1,
uint64_t  bulk = 1 
)
inline

multi channel multi client bulk mix into circular buffer with format conversion if applicable src[client][channel][sample]

return true if data fit into empty space

template<typename data_t >
bool dx::circular::force_write ( data_t *const *const *  src,
uint64_t  clients,
uint64_t  channels,
uint64_t  bulk 
)
inline
void dx::circular::initialize ( uint64_t  backingstore_size)
inline

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dx::circular::initialize ( )
inline

+ Here is the caller graph for this function:

uint64_t dx::circular::loop ( ) const
inline

+ Here is the caller graph for this function:

template<typename exception_t , typename callback_t >
void dx::circular::move ( callback_t &  callback,
uint64_t  max 
)
throw (exception_t
)
inline

+ Here is the call graph for this function:

template<typename data_t >
bool dx::circular::operator<< ( const data_t &  src)
inline
template<typename data_t >
bool dx::circular::operator>> ( data_t &  dst)
inline
template<typename circular_t , typename ext_t >
bool dx::circular::read ( volatile uint64_t position,
ext_t *const *  dst,
uint64_t  bulk,
unsigned int  channels_circular = 1,
unsigned int  channels_dst = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline

multi channel interleaved bulk read from circular buffer with format conversion if applicable

return true if enough data is available in circular space

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename circular_t , typename ext_t >
bool dx::circular::read ( ext_t *const *  dst,
uint64_t  bulk,
unsigned int  channels_circular = 1,
unsigned int  channels_dst = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline
template<typename circular_t , typename ext_t >
bool dx::circular::read ( volatile uint64_t position,
ext_t *  dst,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline
template<typename circular_t , typename ext_t >
bool dx::circular::read ( ext_t *  dst,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline
template<typename data_t >
bool dx::circular::read ( volatile uint64_t position,
data_t *  dst,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline
template<typename data_t >
bool dx::circular::read ( data_t *  dst,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline
template<typename data_t >
bool dx::circular::read ( data_t *const *  dst,
uint64_t  bulk,
unsigned int  channels_circular = 1,
unsigned int  channels_dst = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline
template<typename data_t >
bool dx::circular::read ( volatile uint64_t position,
data_t *const *  dst,
uint64_t  bulk,
unsigned int  channels_circular = 1,
unsigned int  channels_dst = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline
template<typename dst_t = char>
dst_t* dx::circular::simulate_read ( volatile uint64_t position,
uint64_t  bulk = 1 
)
inline

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename dst_t = char>
dst_t* dx::circular::simulate_read ( uint64_t  bulk = 1)
inline
char* dx::circular::simulate_write ( uint64_t  bulk)
inline

simulate write by advancing write idx and take care of wrap write optimization

uint64_t dx::circular::used ( )
inline

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint64_t dx::circular::used ( volatile uint64_t position)
inline
template<typename circular_t , typename ext_t >
bool dx::circular::write ( volatile uint64_t position,
const ext_t *const *  src,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  channels_src = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline

bulk write into circular buffer with format conversion if applicable

return true if data fit into empty space

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename circular_t , typename ext_t >
bool dx::circular::write ( const ext_t *const *  src,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  channels_src = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline

+ Here is the call graph for this function:

template<typename circular_t , typename ext_t >
bool dx::circular::write ( volatile uint64_t position,
const ext_t *  src,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline
template<typename circular_t , typename ext_t >
bool dx::circular::write ( const ext_t *  src,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline
template<typename data_t >
bool dx::circular::write ( volatile uint64_t position,
const data_t *  src,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline
template<typename data_t >
bool dx::circular::write ( const data_t *  src,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline
template<typename data_t >
bool dx::circular::write ( const data_t *const *  src,
uint64_t  bulk = 1,
unsigned int  channels_circular = 1,
unsigned int  channels_src = 1,
unsigned int  circular_offset = 0,
unsigned int  interleaved = 1 
)
inline

Member Data Documentation

volatile uint64_t dx::circular::count

buffer wrap count

char dx::circular::data[1]
volatile uint64_t dx::circular::dropout

drop out counter

volatile uint64_t dx::circular::rx

single consumers current read index

uint64_t dx::circular::size

size of buffer in bytes

volatile int64_t dx::circular::timestamp

current rx/tx timestamp

timestamp of last buffer wrap

volatile uint64_t dx::circular::tx

producers current write index

struct { ... } dx::circular::zero

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

(c) copyright 2009 dynamic acoustics e.U. generated on Tue Dec 4 2018

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.