dxd - dynax driver framework  2979
cross platform open source driver development framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t > Class Template Referenceabstract

generic streaming engine More...

#include <dx_stream_device.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 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...
 
typedef::CFDictionaryRef match
 
typedef::GUID match
 
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 noexceptoverride try
 notification exception handler More...
 
virtual void free () noexcept
 
void halt () noexceptoverride
 
void initialize (const typename clock_t::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 () noexceptoverride
 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 clock_t::time_point &now)
 
void wait () try
 
virtual ~engine () noexcept
 

Protected Attributes

std::shared_ptr< device_t > device
 
clock_t::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
 
clock_t::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 = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_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

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

Constructor & Destructor Documentation

template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::engine ( typename driver::match  match)
inlineprotected
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
virtual dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::~engine ( )
inlineprotectednoexcept

Member Function Documentation

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

notify specific device arrival stub

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:

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

notify specific device arrival stub

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 >.

dx::event< user >::catch ( std::system_error &  exception)
inlineinherited
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::catchall ( )
inlineprotected
dx::clock< clock_t >::catchall_rethrow ( )
inlinenoexceptinherited
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:

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()
template<class device_t = device>
virtual void dx::driver< device_t >::conclude ( )
inlinevirtualnoexceptinherited

+ Here is the caller graph for this function:

template<class device_t = device>
virtual void dx::driver< device_t >::conclude ( )
inlinevirtualnoexceptinherited
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
virtual void dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::detach ( )
inlineprotectedvirtualnoexcept
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_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 >.

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
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
virtual void dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::free ( )
inlineprotectedvirtualnoexcept

+ Here is the caller graph for this function:

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

Reimplemented from dx::clock<>.

+ Here is the caller graph for this function:

template<class device_t = device>
static void dx::driver< device_t >::idle ( int64_t  nsec)
inlinestaticinherited

+ Here is the caller graph for this function:

template<class device_t = device>
static void dx::driver< device_t >::idle ( uint64_t  timeout)
inlinestaticnoexceptinherited
void dx::clock< clock_t >::initialize ( const typename clock_t::duration &  duration)
inlineinherited
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_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
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.

Reimplemented in dx::coremidi::stream< io_t, bus_t, stream_desc_t, device_t >.

template<class device_t = device>
virtual void dx::driver< device_t >::launch ( )
inlinevirtualinherited

+ Here is the caller graph for this function:

template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_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

template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_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<>.

+ Here is the caller graph for this function:

dx::event< kernel >::operator os_event ( )
inlinenoexceptinherited
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
virtual void dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::overload ( )
inlineprotectedvirtualnoexcept
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
virtual void dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::process ( int64_t  timestamp)
protectedpure virtualnoexcept
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:

event& dx::event< user >::reset ( )
inlineinherited

+ Here is the caller graph for this function:

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

Reimplemented from dx::clock<>.

template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::samplerate ( ) const
inlineprotected
event& dx::event< user >::signal ( )
inlineinherited

+ Here is the caller graph for this function:

virtual void dx::clock< clock_t >::sync ( const typename clock_t::time_point &  now)
inlineprotectedvirtualinherited
void dx::clock< clock_t >::wait ( )
inlineinherited

Member Data Documentation

template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
circular* dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::circular[direction]
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
std::shared_ptr<device_t> dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::device
protected
clock_t::duration dx::clock< clock_t >::duration
protectedinherited
Todo:
evaluate clock::status replacement (exception?)
T std::deque< T >::elements
inherited

STL member.

template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
force_write dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::force_write
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
uint64_t dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::frame = 0
protected
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_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

template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
int** dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::io[direction][2] {}
protected
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::iosize =0
protected
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::linesize
template<class device_t = device>
typedef::CFDictionaryRef dx::driver< device_t >::match
inherited
template<class device_t = device>
typedef::GUID dx::driver< device_t >::match
inherited
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_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]

std::mutex dx::clock< clock_t >::mutex
protectedinherited
clock_t::time_point dx::clock< clock_t >::objective
protectedinherited
struct { ... } dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::observer
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
std::shared_ptr<pin_t> dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::pin[direction]
protected
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
read dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::read
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
circular* dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::reference
volatile bool dx::clock< clock_t >::running
protectedinherited
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::rx
struct { ... } dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::safety_offset
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
volatile unsigned int* dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::samplerate
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::samplerate
os_result dx::clock< clock_t >::status
protectedinherited
struct { ... } dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::sync
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_t>>
int64_t dx::stream::engine< io_t, bus_t, desc_t, device_t, pin_t >::trigger
template<typename io_t, typename bus_t, typename desc_t, typename device_t = device<desc_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin,device_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 Fri Nov 8 2019

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.