dxd - dynax driver framework  2711
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, exception_t, device_t, pin_t > Class Template Referenceabstract

generic streaming engine More...

#include <dx_stream.h>

+ Inheritance diagram for dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >:
+ Collaboration diagram for dx::stream::engine< io_t, bus_t, desc_t, exception_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 () throw (exception_t)
 
virtual void launch () throw (exception_t)
 
void samplerate (unsigned int samplerate) throw (exception_t)
 
unsigned int samplerate () throw (exception_t)
 

Static Public Member Functions

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

Public Attributes

elements
 STL member. More...
 
typedef::CFDictionaryRef match
 
typedef::GUID match
 
unsigned int comperator =0
 
volatile unsigned int * samplerate =nullptr
 

Protected Types

typedef dx::clock< exception_t > clock
 
typedef driver< exception_t,
device_t > 
driver
 

Protected Member Functions

virtual void arrived (device_t &) throw (exception_t)
 notify specific device arrival stub More...
 
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 (const match match)
 
virtual void exception (const exception_t &) const noexcept
 notification exception handler More...
 
virtual void exception (const exception_t &) const noexcept
 notification exception handler More...
 
virtual void free () noexcept
 
void halt () noexceptoverride
 
void initialize (const typename clock_t::duration &duration) noexcept
 
template<int channels>
void initialize (unsigned int iosize, uint64_t channel_map[2][(channels+63)/64]) throw (exception_t)
 
virtual void notify (unsigned int) noexcept
 notify sample rate change from device More...
 
virtual void notify () noexceptoverride
 notify change from device requiring streaming reset More...
 
virtual void overload () noexcept
 
virtual void process (int64_t timestamp) noexcept=0
 
virtual void removed () noexcept
 notify device removals completed stub More...
 
void run () override throw (exception_t)
 
virtual void sync (const typename clock_t::time_point &now) throw (exception_t)
 
virtual ~engine () noexcept
 

Protected Attributes

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

Detailed Description

template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
class dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >

generic streaming engine

Exceptions
incase of an error returned by the underlaying API the device class throws an exception converted from dx::os_result. with the default exception_t=dx::os_error template parameter the dx::os_result itself will be thrown.

Member Typedef Documentation

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

Constructor & Destructor Documentation

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

Member Function Documentation

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

notify specific device arrival stub

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

+ Here is the caller graph for this function:

template<class exception_t = os_result, class device_t = device<exception_t>>
virtual void dx::driver< exception_t, device_t >::conclude ( )
inlinevirtualnoexceptinherited
template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
virtual void dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::detach ( )
inlineprotectedvirtualnoexcept
template<class exception_t = os_result, class device_t = device<exception_t>>
virtual void dx::driver< exception_t, device_t >::exception ( const exception_t &  ) const
inlineprotectedvirtualnoexceptinherited

notification exception handler

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

+ Here is the caller graph for this function:

template<class exception_t = os_result, class device_t = device<exception_t>>
virtual void dx::driver< exception_t, device_t >::exception ( const exception_t &  ) const
inlineprotectedvirtualnoexceptinherited
template<class exception_t = os_result, class device_t = device<exception_t>>
device_t* dx::driver< exception_t, 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 exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
virtual void dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::free ( )
inlineprotectedvirtualnoexcept
template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
void dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::halt ( )
inlineoverrideprotectedvirtualnoexcept

Reimplemented from dx::clock< exception_t >.

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

+ Here is the caller graph for this function:

template<class exception_t = os_result, class device_t = device<exception_t>>
static void dx::driver< exception_t, device_t >::idle ( uint64_t  timeout)
inlinestaticnoexceptinherited
void dx::clock< exception_t, clock_t >::initialize ( const typename clock_t::duration &  duration)
inlinenoexceptinherited
template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
template<int channels>
void dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::initialize ( unsigned int  iosize,
uint64_t  channel_map[2][(channels+63)/64] 
)
throw (exception_t
)
inlineprotected
Todo:
clock already runnning with different iosize: check if engine should be initialized with current iosize
template<class exception_t = os_result, class device_t = device<exception_t>>
virtual void dx::driver< exception_t, device_t >::launch ( )
throw (exception_t
)
inlinevirtualinherited

+ Here is the caller graph for this function:

template<class exception_t = os_result, class device_t = device<exception_t>>
virtual void dx::driver< exception_t, device_t >::launch ( )
throw (exception_t
)
inlinevirtualinherited
template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
virtual void dx::stream::engine< io_t, bus_t, desc_t, exception_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 exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
virtual void dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::notify ( )
inlineoverrideprotectedvirtualnoexcept
template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
virtual void dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::overload ( )
inlineprotectedvirtualnoexcept
template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
virtual void dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::process ( int64_t  timestamp)
protectedpure virtualnoexcept
template<class exception_t = os_result, class device_t = device<exception_t>>
virtual void dx::driver< exception_t, device_t >::removed ( )
inlineprotectedvirtualnoexceptinherited

notify device removals completed stub

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

+ Here is the caller graph for this function:

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

Reimplemented from dx::clock< exception_t >.

template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
void dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::samplerate ( unsigned int  samplerate)
throw (exception_t
)
inline
template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::samplerate ( )
throw (exception_t
)
inline
virtual void dx::clock< exception_t, clock_t >::sync ( const typename clock_t::time_point &  now)
throw (exception_t
)
inlineprotectedvirtualinherited

Member Data Documentation

template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::comperator =0
template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
std::shared_ptr<device_t> dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::device
protected
clock_t::duration dx::clock< exception_t, clock_t >::duration
protectedinherited
T std::deque< T >::elements
inherited

STL member.

template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
uint64_t dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::frame = 0
protected
template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
int** dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::io[2][2] ={}
protected
template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
unsigned int dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::iosize =0
protected
template<class exception_t = os_result, class device_t = device<exception_t>>
typedef::CFDictionaryRef dx::driver< exception_t, device_t >::match
inherited
template<class exception_t = os_result, class device_t = device<exception_t>>
typedef::GUID dx::driver< exception_t, device_t >::match
inherited
template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
dx::stream::clock::monitor* dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::monitor =nullptr
protected

io[direction][double buffer][channel]

std::mutex dx::clock< exception_t, clock_t >::mutex
protectedinherited
clock_t::time_point dx::clock< exception_t, clock_t >::objective
protectedinherited
template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
std::shared_ptr<pin_t> dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::pin[2]
protected
volatile bool dx::clock< exception_t, clock_t >::running
protectedinherited
template<typename io_t, typename bus_t, typename desc_t, typename exception_t = os_result, typename device_t = device<desc_t,exception_t>, typename pin_t = pin<io_t,bus_t,struct desc_t::stream::pin>>
volatile unsigned int* dx::stream::engine< io_t, bus_t, desc_t, exception_t, device_t, pin_t >::samplerate =nullptr
os_result dx::clock< exception_t, clock_t >::status
protectedinherited

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

(c) copyright 2009 dynamic acoustics e.U. generated on Mon Feb 25 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.