dxd - dynax driver framework  3211
cross platform open source driver development framework
dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t > Class Template Referenceabstract

generic streaming engine More...

#include <dx_stream_engine.h>

+ Inheritance diagram for dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >:
+ Collaboration diagram for dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >:

Public Types

typedef ::CFDictionaryRef match
 
typedef ::GUID match
 

Public Member Functions

virtual void conclude () noexcept
 
virtual void conclude () noexcept
 
device_t * find (std::string uid) const noexcept
 Finds the device by guid.
The user is responsible for making sure the device list cannot be modified during find(). More...
 
virtual void launch ()
 

Static Public Member Functions

static void idle (int64_t nsec)
 
static void idle (uint64_t timeout) noexcept
 

Public Attributes

elements
 STL member. More...
 
circularcircular [direction]
 
force_write force_write
 
unsigned int interval
 clock resolution: HW stream frame size in samples More...
 
unsigned int linesize
 
struct {
   volatile unsigned int *   samplerate
 
observer
 
read read
 
circularreference
 
unsigned int rx
 
struct {
   unsigned int   rx
 
   unsigned int   tx
 
safety_offset
 
unsigned int samplerate
 
struct {
   unsigned int   interval
 clock resolution: HW stream frame size in samples More...
 
   unsigned int   linesize
 
   circular *   reference
 
   struct {
      unsigned int   rx
 
      unsigned int   tx
 
   }   safety_offset
 
   unsigned int   samplerate
 
   int64_t   trigger
 
sync
 

Protected Types

typedef driver< device_t > driver
 

Protected Member Functions

virtual void arrived (device_t &)
 notify specific device arrival stub More...
 
virtual void arrived ()
 notify device arrivals completed stub More...
 
virtual void arrived (device_t &)
 notify specific device arrival stub More...
 
virtual void arrived ()
 notify device arrivals completed stub More...
 
 catch (std::system_error &exception)
 
 catchall () public
 
 catchall_rethrow () virtual ~clock() noexcept
 
virtual void clear () noexcept
 replaces non-virtual std::deque::clear to call virtual notification methods More...
 
virtual void clear () noexcept
 replaces non-virtual std::deque::clear to call virtual notification methods More...
 
virtual void detach () noexcept
 
 engine (typename driver::match match)
 
void exception (const dx::exception &exception) const noexcept override try
 notification exception handler More...
 
virtual void free () noexcept
 
void halt () noexcept override
 
void initialize (const typename std::chrono::high_resolution_clock ::duration &duration)
 
template<int channels>
void initialize (unsigned int iosize, uint64_t channel_map[2][(channels+63)/64])
 
virtual void launch ()
 
virtual void notify (unsigned int) noexcept
 notify sample rate change from device More...
 
void notify () noexcept override
 notify change from device requiring streaming reset More...
 
 operator os_event () noexcept
 
virtual void overload () noexcept
 
virtual void process (int64_t timestamp) noexcept=0
 
virtual void removed () noexcept
 notify device removals completed stub More...
 
eventreset () try
 
void run () override
 
unsigned int samplerate () const
 
eventsignal () try
 
virtual void sync (const typename std::chrono::high_resolution_clock ::time_point &now)
 
void wait () try
 
virtual ~engine () noexcept
 

Protected Attributes

std::shared_ptr< device_t > device
 
std::chrono::high_resolution_clock ::duration duration
 
uint64_t frame = 0
 
int ** io [direction][2] {}
 
unsigned int iosize =0
 
dx::stream::clock::monitormonitor =nullptr
 io[direction][double buffer][channel][sample] More...
 
std::mutex mutex
 
std::chrono::high_resolution_clock ::time_point objective
 
std::shared_ptr< pin_t > pin [direction]
 
volatile bool running
 
os_result status
 

Detailed Description

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
class dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >

generic streaming engine

Exceptions
incase of an error returned by the underlaying API the device class throws a dx::exception.

Member Typedef Documentation

◆ driver

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
typedef driver<device_t> dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::driver
protected

◆ match [1/2]

template<class device_t = device>
typedef ::CFDictionaryRef dx::driver< device_t >::match
inherited

◆ match [2/2]

template<class device_t = device>
typedef ::GUID dx::driver< device_t >::match
inherited

Constructor & Destructor Documentation

◆ engine()

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::engine ( typename driver::match  match)
inlineprotected

◆ ~engine()

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
virtual dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::~engine ( )
inlineprotectednoexcept

Member Function Documentation

◆ arrived() [1/4]

template<class device_t = device>
virtual void dx::driver< device_t >::arrived ( device_t &  )
inlineprotectedvirtualinherited

notify specific device arrival stub

◆ arrived() [2/4]

template<class device_t = device>
virtual void dx::driver< device_t >::arrived ( )
inlineprotectedvirtualinherited

notify device arrivals completed stub

Reimplemented in dx::coreaudio::plugin< io_t, bus_t, desc_t >.

+ Here is the caller graph for this function:

◆ arrived() [3/4]

template<class device_t = device>
virtual void dx::driver< device_t >::arrived ( device_t &  )
inlineprotectedvirtualinherited

notify specific device arrival stub

◆ arrived() [4/4]

template<class device_t = device>
virtual void dx::driver< device_t >::arrived ( )
inlineprotectedvirtualinherited

notify device arrivals completed stub

Reimplemented in dx::coreaudio::plugin< io_t, bus_t, desc_t >.

◆ catch()

dx::event< user >::catch ( std::system_error &  exception)
inlineinherited

◆ catchall()

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::catchall ( )
inlineprotected

◆ catchall_rethrow()

dx::clock< std::chrono::high_resolution_clock >::catchall_rethrow ( )
inlinenoexceptinherited

◆ clear() [1/2]

template<class device_t = device>
virtual void dx::driver< device_t >::clear ( )
inlineprotectedvirtualnoexceptinherited

replaces non-virtual std::deque::clear to call virtual notification methods

Todo:
check if exception catching needed for device::conclude()
+ Here is the caller graph for this function:

◆ clear() [2/2]

template<class device_t = device>
virtual void dx::driver< device_t >::clear ( )
inlineprotectedvirtualnoexceptinherited

replaces non-virtual std::deque::clear to call virtual notification methods

Todo:
check if exception catching needed for device::conclude()

◆ conclude() [1/2]

template<class device_t = device>
virtual void dx::driver< device_t >::conclude ( )
inlinevirtualnoexceptinherited

◆ conclude() [2/2]

template<class device_t = device>
virtual void dx::driver< device_t >::conclude ( )
inlinevirtualnoexceptinherited

◆ detach()

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
virtual void dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::detach ( )
inlineprotectedvirtualnoexcept

◆ exception()

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
void dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::exception ( const dx::exception ) const
inlineoverrideprotectedvirtualnoexcept

notification exception handler

Reimplemented from dx::driver< device_t >.

◆ find()

template<class device_t = device>
device_t* dx::driver< device_t >::find ( std::string  uid) const
inlinenoexceptinherited

Finds the device by guid.
The user is responsible for making sure the device list cannot be modified during find().

Exceptions
n/athis method does not throw exceptions

◆ free()

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
virtual void dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::free ( )
inlineprotectedvirtualnoexcept

◆ halt()

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
void dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::halt ( )
inlineoverrideprotectedvirtualnoexcept

Reimplemented from dx::clock<>.

◆ idle() [1/2]

template<class device_t = device>
static void dx::driver< device_t >::idle ( int64_t  nsec)
inlinestaticinherited
+ Here is the caller graph for this function:

◆ idle() [2/2]

template<class device_t = device>
static void dx::driver< device_t >::idle ( uint64_t  timeout)
inlinestaticnoexceptinherited

◆ initialize() [1/2]

void dx::clock< std::chrono::high_resolution_clock >::initialize ( const typename std::chrono::high_resolution_clock<> ::duration duration)
inlineinherited

◆ initialize() [2/2]

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
template<int channels>
void dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::initialize ( unsigned int  iosize,
uint64_t  channel_map[2][(channels+63)/64] 
)
inlineprotected
Todo:
clock already runnning with different iosize: check if engine should be initialized with current iosize

◆ launch() [1/2]

virtual void dx::event< kernel >::launch ( )
inlinevirtualinherited

The default implementation is based on event<user> which is signalled when triggered via launch() from kernel. This is to achieve compatibility with Windows events. Its probably more adequate to overwrite launch() and do the work here if feasible.

◆ launch() [2/2]

template<class device_t = device>
virtual void dx::driver< device_t >::launch ( )
inlinevirtualinherited
+ Here is the caller graph for this function:

◆ notify() [1/2]

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
virtual void dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::notify ( unsigned  int)
inlineprotectedvirtualnoexcept

notify sample rate change from device

◆ notify() [2/2]

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
void dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::notify ( )
inlineoverrideprotectedvirtualnoexcept

notify change from device requiring streaming reset

Reimplemented from dx::clock<>.

◆ operator os_event()

dx::event< kernel >::operator os_event ( )
inlinenoexceptinherited

◆ overload()

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
virtual void dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::overload ( )
inlineprotectedvirtualnoexcept

◆ process()

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
virtual void dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::process ( int64_t  timestamp)
protectedpure virtualnoexcept

◆ removed()

template<class device_t = device>
virtual void dx::driver< device_t >::removed ( )
inlineprotectedvirtualnoexceptinherited

notify device removals completed stub

Reimplemented in dx::coreaudio::plugin< io_t, bus_t, desc_t >.

+ Here is the caller graph for this function:

◆ reset()

event& dx::event< user >::reset ( )
inlineinherited
+ Here is the caller graph for this function:

◆ run()

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
void dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::run ( )
inlineoverrideprotectedvirtual

Reimplemented from dx::clock<>.

◆ samplerate()

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::samplerate ( ) const
inlineprotected

◆ signal()

event& dx::event< user >::signal ( )
inlineinherited
+ Here is the caller graph for this function:

◆ sync()

virtual void dx::clock< std::chrono::high_resolution_clock >::sync ( const typename std::chrono::high_resolution_clock<> ::time_point &  now)
inlineprotectedvirtualinherited

◆ wait()

void dx::clock< std::chrono::high_resolution_clock >::wait ( )
inlineinherited

Member Data Documentation

◆ circular

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
circular* dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::circular[direction]

◆ device

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
std::shared_ptr<device_t> dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::device
protected

◆ duration

std::chrono::high_resolution_clock ::duration dx::clock< std::chrono::high_resolution_clock >::duration
protectedinherited
Todo:
evaluate clock::status replacement (exception?)

◆ elements

T std::deque< T >::elements
inherited

STL member.

◆ force_write

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
force_write dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::force_write

◆ frame

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
uint64_t dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::frame = 0
protected

◆ interval

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::interval

clock resolution: HW stream frame size in samples

◆ io

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
int** dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::io[direction][2] {}
protected

◆ iosize

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::iosize =0
protected

◆ linesize

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::linesize

◆ monitor

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
dx::stream::clock::monitor* dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::monitor =nullptr
protected

io[direction][double buffer][channel][sample]

◆ mutex

std::mutex dx::clock< std::chrono::high_resolution_clock >::mutex
protectedinherited

◆ objective

std::chrono::high_resolution_clock ::time_point dx::clock< std::chrono::high_resolution_clock >::objective
protectedinherited

◆ observer

struct { ... } dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::observer

◆ pin

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
std::shared_ptr<pin_t> dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::pin[direction]
protected

◆ read

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
read dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::read

◆ reference

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
circular* dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::reference

◆ running

volatile bool dx::clock< std::chrono::high_resolution_clock >::running
protectedinherited

◆ rx

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::rx

◆ safety_offset

struct { ... } dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::safety_offset

◆ samplerate [1/2]

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
volatile unsigned int* dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::samplerate

◆ samplerate [2/2]

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::samplerate

◆ status

os_result dx::clock< std::chrono::high_resolution_clock >::status
protectedinherited

◆ sync

struct { ... } dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::sync

◆ trigger

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
int64_t dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::trigger

◆ tx

template<typename io_t, typename bus_t, typename desc_t, typename device_t, typename pin_t>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::tx

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

(c) copyright 2009 dynamic acoustics e.U. generated on Sat Aug 22 2020

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.