dxd - dynax driver framework 3.0.1d223
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::stream::clock Struct Reference

select/get stream sample rate/iosize More...

#include <dx_stream.h>

Classes

struct  consumer
 one clock consumer's share of the domain: its buffer switch is due every iosize samples More...
struct  monitor
 performance monitor shared memory More...

Public Types

enum  bitmap : uint32_t {
  none = 0 , rate8 = 1<< 0 , rate16 = 1<< 1 , rate22 = 1<< 2 ,
  rate32 = 1<< 3 , rate44 = 1<< 4 , rate48 = 1<< 5 , rate88 = 1<< 6 ,
  rate96 = 1<< 7 , rate176 =1<< 8 , rate192 =1<< 9 , rate352 =1<< 10 ,
  rate384 =1<< 11 , rates = 12 , lo = rate44|rate48 , mid = rate88|rate96 ,
  hi = rate176|rate192 , ex = rate352|rate384 , lomid = lo|mid , std = hi|mid|lo
}
enum  strategy : uint32_t { plain , yield , spin }

Static Public Member Functions

static uint32_t align (bitmapbitmap bitmapbitmap, uint32_t samplerate)
static bool describe (std::ostream &os, const enum bitmapbitmap &bitmapbitmap, uint32_t samplerate=0)
static uint32_t frequency (uint32_t shift)
 frequency helper functions returns the numerical frequency from given sample rate bit field
static bitmap range (uint32_t min, uint32_t max)
 frequency alignment helper functions aligns the sample rate from given numerical frequency to the closest valid frequency given in the bitfield
static bitmap shift (uint32_t frequency)
 frequency helper functions returns the sample rate bit field from given numerical frequency
template<typename source_t>
static void wait (source_t &source, strategystrategy strategystrategy, int64_t objective)
 waits toward objective, in ns: the source's timer up to the strategy's lead, polling the rest - the environment supplies now() in ns, sleep(ns), false where a halt cut it short, and relax(strategy), one poll step

Public Attributes

uint32_t domain {}
 clock domain bitfield

Static Public Attributes

static constexpr uint32_t frequencies [] {8000, 16000, 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000}
static constexpr int64_t lead [] {0, 2000000, 2000000}
static constexpr const char * strategy_name [] {"plain", "yield", "spin"}
 index= the strategy value

Detailed Description

select/get stream sample rate/iosize

Member Enumeration Documentation

◆ bitmap

Enumerator
none 
rate8 
rate16 
rate22 
rate32 
rate44 
rate48 
rate88 
rate96 
rate176 
rate192 
rate352 
rate384 
rates 
lo 
mid 
hi 
ex 
lomid 
std 

◆ strategy

Enumerator
plain 
yield 
spin 

Member Function Documentation

◆ align()

uint32_t dx::stream::clock::align ( bitmap bitmap,
uint32_t samplerate )
inlinestatic
Here is the caller graph for this function:

◆ describe()

bool dx::stream::clock::describe ( std::ostream & os,
const enum bitmap & bitmap,
uint32_t samplerate = 0 )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ frequency()

uint32_t dx::stream::clock::frequency ( uint32_t shift)
inlinestatic

frequency helper functions returns the numerical frequency from given sample rate bit field

Here is the call graph for this function:
Here is the caller graph for this function:

◆ range()

bitmap dx::stream::clock::range ( uint32_t min,
uint32_t max )
inlinestatic

frequency alignment helper functions aligns the sample rate from given numerical frequency to the closest valid frequency given in the bitfield

Here is the caller graph for this function:

◆ shift()

bitmap dx::stream::clock::shift ( uint32_t frequency)
inlinestatic

frequency helper functions returns the sample rate bit field from given numerical frequency

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wait()

template<typename source_t>
void dx::stream::clock::wait ( source_t & source,
strategy strategy,
int64_t objective )
inlinestatic

waits toward objective, in ns: the source's timer up to the strategy's lead, polling the rest - the environment supplies now() in ns, sleep(ns), false where a halt cut it short, and relax(strategy), one poll step

Here is the caller graph for this function:

Member Data Documentation

◆ domain

uint32_t dx::stream::clock::domain {}

clock domain bitfield

◆ frequencies

uint32_t dx::stream::clock::frequencies[] {8000, 16000, 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000}
staticconstexpr

◆ lead

int64_t dx::stream::clock::lead[] {0, 2000000, 2000000}
staticconstexpr

ns by strategy: how early a wait hands over from its timer to polling

◆ strategy_name

const char* dx::stream::clock::strategy_name[] {"plain", "yield", "spin"}
staticconstexpr

index= the strategy value


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

(c) copyright 2009 dynamic acoustics e.U. generated on

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.