dxd - dynax driver framework 2.1.0d71
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::generic::driver Class Referenceabstract

generic driver interface class More...

#include <dx_driver.h>

+ Inheritance diagram for dx::generic::driver:
+ Collaboration diagram for dx::generic::driver:

Classes

class  setup
 

Public Types

typedef decltype(matching_dictionaries) match
 
typedef ::GUID match
 

Public Member Functions

virtual void conclude () noexcept
 
virtual void conclude () noexcept
 
::CFStringRef copy () const
 
 driver (const ::GUID &guid, const char *id, dx::log log={})
 the driver interface class constructor
 
 driver (const match &matching_dictionaries, const char *id, dx::log log)
 the driver interface class constructor
 
 dx_catchall () static void idle(int64_t nsec)
 
 dx_catchall () static void idle(uint64_t timeout) noexcept
 
virtual void exception (const exception &exception, bool filtered=false) const noexcept try
 notification exception handler
 
virtual void exception (const exception &exception, bool filtered=false) const noexcept try
 notification exception handler
 
CFTypeID id () noexcept
 
CFTypeID id () noexcept
 
CFTypeID id () noexcept
 
CFTypeID id () noexcept
 
CFTypeID id () noexcept
 
CFTypeID id () noexcept
 
CFTypeID id () noexcept
 
CFTypeID id () noexcept
 
CFTypeID id () noexcept
 
CFTypeID id () noexcept
 
referenceinitialize (cf_object_t cf_object, bool retain=true)
 
virtual void launch ()
 
virtual void launch ()
 
 operator bool () const noexcept
 
 operator cf_object_t () const noexcept
 
 operator const char * () const
 
 operator double () const noexcept
 Skips whitespace; returns 0.0 on error.
 
 operator int32_t () const noexcept
 Skips whitespace; returns 0 on error, MAX or -MAX on overflow.
 
 operator std::string () const
 
template<typename petty_t = cf_object_t, typename = typename std::enable_if_t <!std::is_same_v<petty_t, ::CFTypeRef>>>
 operator type<> () const noexcept
 
bool operator!= (::CFStringRef value) const noexcept
 
bool operator!= (cf_object_t cf_object) const noexcept
 
bool operator!= (value_t value)
 
::CFMutableStringRef operator+ (::CFStringRef value) const noexcept
 
::CFMutableStringRef operator+ (const char *value) const noexcept
 
 operator::CFDataRef () const noexcept
 
 operator::CFTypeID () const noexcept
 
template<typename petty_t = cf_object_t, typename = typename std::enable_if_t <!std::is_same_v<petty_t, ::CFTypeRef>>>
 operator::CFTypeRef () const noexcept
 
bool operator< (::CFStringRef value) const noexcept
 
bool operator< (value_t value)
 
bool operator<= (::CFStringRef value) const noexcept
 
bool operator<= (value_t value)
 
bool operator== (::CFStringRef value) const noexcept
 
bool operator== (cf_object_t cf_object) const noexcept
 
bool operator== (value_t value)
 
bool operator> (::CFStringRef value) const noexcept
 
bool operator> (value_t value)
 
bool operator>= (::CFStringRef value) const noexcept
 
bool operator>= (value_t value)
 
referencerelease () noexcept
 
referenceretain () noexcept
 

Static Public Member Functions

::CFTypeID id () noexcept
 

Public Attributes

::CFStringRef cf_type_desc = nullptr
 
::CFStringRef cf_type_id = nullptr
 
bool launched = false
 
log log {}
 
dx::log log {}
 
cf::preference preference
 
dx::registry preference
 
dx::generic::driver::setup setup
 

Protected Member Functions

virtual void arrived ()
 notify device arrivals completed stub
 
 operator::CFRunLoopSourceRef () const noexcept
 
 operator::IONotificationPortRef () const noexcept
 
 operator::mach_port_t () const noexcept
 
virtual void removed () noexcept
 notify device removals completed stub
 
virtual ~driver () noexcept
 

Protected Attributes

cf_object_t cf_object = nullptr
 

Detailed Description

generic driver interface class

this is the generic interface to a driver identified by an GUID. the template parameter defines the exception class to be thrown. the driver class is a helper to create a device object and to bind the device to the driver identified by the GUID.

example:

try() { // guard the block
// choose a driver
dx::driver<>driver(GUID_MYDEVICE);
// for your information enumerate all devices registered under this driver:
std::cout << driver.count() << " devices found." << std::endl;
// define the device reference focus
{
// create a device and select the first device
dx::reference<dx::device<> >device=*driver.begin()
// return an int from an IOCTL served by the driver
int my_data=device->ioctl<int>(kMyIoctl);
// by letting the reference run out of focus the device is freed and the
// driver object can release it as a reaction to a device removal notification
}
}
catch (dx::os_result result) { // with the default exception_t=dx::os_result template parameter an dx::os_result will be thrown
std::cerr << "OS aborted operation with error #" << result << std::endl;
}
generic device interface class
Definition macOS/dx_device.h:66
size_t ioctl(uint32_t ioctl, const tx_t &tx, rx_t &rx) const
Definition macOS/dx_device.h:195
Definition macOS/dx_driver.h:230
generic driver interface class
Definition macOS/dx_driver.h:61
::mach_error_t os_result
Definition macOS/dx_platform.h:159
Exceptions
incase of an error returned by the underlaying API the driver class throws an exception converted from HRESEULT. with the default exception_t=HRESULT template parameter the HRESULT itself will be thrown.
Todo
distinguish between "driver not installed" and "no device"

Member Typedef Documentation

◆ match [1/2]

typedef decltype(matching_dictionaries) dx::generic::driver::match

◆ match [2/2]

Constructor & Destructor Documentation

◆ driver() [1/2]

dx::generic::driver::driver ( const match & matching_dictionaries,
const char * id,
dx::log log )
inline

the driver interface class constructor

Todo
handle kext blocking https://developer.apple.com/library/content/technotes/tn2459/_index.html

checks if kext is installed at all

Parameters
matching_dictionariesthe matching dictionaries identifying the driver interface
iddrivers bundle ID
loglogging settings

◆ ~driver()

◆ driver() [2/2]

dx::generic::driver::driver ( const ::GUID & guid,
const char * id,
dx::log log = {} )
inline

the driver interface class constructor

Parameters
guidthe GUID identifying the driver interface

Member Function Documentation

◆ arrived()

◆ conclude() [1/2]

◆ conclude() [2/2]

◆ copy()

::CFStringRef dx::cf::__string< ::CFStringRef >::copy ( ) const
inlineinherited

◆ dx_catchall() [1/2]

dx::generic::driver::dx_catchall ( )
inline
+ Here is the caller graph for this function:

◆ dx_catchall() [2/2]

dx::generic::driver::dx_catchall ( )
inlinenoexcept

◆ exception() [1/2]

virtual void dx::generic::driver::exception ( const exception & exception,
bool filtered = false ) const
inlinevirtualnoexcept

notification exception handler

+ Here is the caller graph for this function:

◆ exception() [2/2]

virtual void dx::generic::driver::exception ( const exception & exception,
bool filtered = false ) const
inlinevirtualnoexcept

notification exception handler

◆ id() [1/11]

template<typename cf_object_t >
::CFTypeID dx::cf::reference< cf_object_t >::id ( )
staticnoexceptinherited
+ Here is the caller graph for this function:

◆ id() [2/11]

CFTypeID dx::cf::reference<::CFDictionaryRef >::id ( )
inlinenoexceptinherited

◆ id() [3/11]

CFTypeID dx::cf::reference<::CFMutableDictionaryRef >::id ( )
inlinenoexceptinherited

◆ id() [4/11]

CFTypeID dx::cf::reference<::CFNumberRef >::id ( )
inlinenoexceptinherited

◆ id() [5/11]

CFTypeID dx::cf::reference<::CFStringRef >::id ( )
inlinenoexceptinherited

◆ id() [6/11]

CFTypeID dx::cf::reference<::CFArrayRef >::id ( )
inlinenoexceptinherited

◆ id() [7/11]

CFTypeID dx::cf::reference<::CFURLRef >::id ( )
inlinenoexceptinherited

◆ id() [8/11]

CFTypeID dx::cf::reference<::CFBundleRef >::id ( )
inlinenoexceptinherited

◆ id() [9/11]

CFTypeID dx::cf::reference<::CFDataRef >::id ( )
inlinenoexceptinherited

◆ id() [10/11]

CFTypeID dx::cf::reference<::CFUUIDRef >::id ( )
inlinenoexceptinherited

◆ id() [11/11]

CFTypeID dx::cf::reference<::SCPreferencesRef >::id ( )
inlinenoexceptinherited

◆ initialize()

template<typename cf_object_t >
reference & dx::cf::reference< cf_object_t >::initialize ( cf_object_t cf_object,
bool retain = true )
inlineinherited
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ launch() [1/2]

virtual void dx::generic::driver::launch ( )
inlinevirtual
+ Here is the caller graph for this function:

◆ launch() [2/2]

virtual void dx::generic::driver::launch ( )
inlinevirtual
+ Here is the call graph for this function:

◆ operator bool()

template<typename cf_object_t >
dx::cf::reference< cf_object_t >::operator bool ( ) const
inlinenoexceptinherited

◆ operator cf_object_t()

template<typename cf_object_t >
dx::cf::reference< cf_object_t >::operator cf_object_t ( ) const
inlinenoexceptinherited

◆ operator const char *()

dx::cf::__string< ::CFStringRef >::operator const char * ( ) const
inlineinherited

◆ operator double()

dx::cf::__string< ::CFStringRef >::operator double ( ) const
inlinenoexceptinherited

Skips whitespace; returns 0.0 on error.

◆ operator int32_t()

dx::cf::__string< ::CFStringRef >::operator int32_t ( ) const
inlinenoexceptinherited

Skips whitespace; returns 0 on error, MAX or -MAX on overflow.

◆ operator std::string()

dx::cf::__string< ::CFStringRef >::operator std::string ( ) const
inlineinherited

◆ operator type<>()

template<typename cf_object_t >
template<typename petty_t = cf_object_t, typename = typename std::enable_if_t <!std::is_same_v<petty_t, ::CFTypeRef>>>
dx::cf::reference< cf_object_t >::operator type<> ( ) const
noexceptinherited

◆ operator!=() [1/3]

bool dx::cf::__string< ::CFStringRef >::operator!= ( ::CFStringRef value) const
inlinenoexceptinherited

◆ operator!=() [2/3]

template<typename cf_object_t >
bool dx::cf::reference< cf_object_t >::operator!= ( cf_object_t cf_object) const
inlinenoexceptinherited

◆ operator!=() [3/3]

bool dx::cf::__string< ::CFStringRef >::operator!= ( value_t value)
inlineinherited

◆ operator+() [1/2]

::CFMutableStringRef dx::cf::__string< ::CFStringRef >::operator+ ( ::CFStringRef value) const
inlinenoexceptinherited

◆ operator+() [2/2]

::CFMutableStringRef dx::cf::__string< ::CFStringRef >::operator+ ( const char * value) const
inlinenoexceptinherited

◆ operator::CFDataRef()

dx::cf::__string< ::CFStringRef >::operator::CFDataRef ( ) const
inlinenoexceptinherited

◆ operator::CFRunLoopSourceRef()

dx::io::power::operator::CFRunLoopSourceRef ( ) const
inlinenoexceptinherited

◆ operator::CFTypeID()

template<typename cf_object_t >
dx::cf::reference< cf_object_t >::operator::CFTypeID ( ) const
inlinenoexceptinherited

◆ operator::CFTypeRef()

template<typename cf_object_t >
template<typename petty_t = cf_object_t, typename = typename std::enable_if_t <!std::is_same_v<petty_t, ::CFTypeRef>>>
dx::cf::reference< cf_object_t >::operator::CFTypeRef ( ) const
inlinenoexceptinherited

◆ operator::IONotificationPortRef()

dx::io::power::operator::IONotificationPortRef ( ) const
inlinenoexceptinherited

◆ operator::mach_port_t()

dx::io::power::operator::mach_port_t ( ) const
inlinenoexceptinherited

◆ operator<() [1/2]

bool dx::cf::__string< ::CFStringRef >::operator< ( ::CFStringRef value) const
inlinenoexceptinherited

◆ operator<() [2/2]

bool dx::cf::__string< ::CFStringRef >::operator< ( value_t value)
inlineinherited

◆ operator<=() [1/2]

bool dx::cf::__string< ::CFStringRef >::operator<= ( ::CFStringRef value) const
inlinenoexceptinherited

◆ operator<=() [2/2]

bool dx::cf::__string< ::CFStringRef >::operator<= ( value_t value)
inlineinherited

◆ operator==() [1/3]

bool dx::cf::__string< ::CFStringRef >::operator== ( ::CFStringRef value) const
inlinenoexceptinherited

◆ operator==() [2/3]

template<typename cf_object_t >
bool dx::cf::reference< cf_object_t >::operator== ( cf_object_t cf_object) const
inlinenoexceptinherited

◆ operator==() [3/3]

bool dx::cf::__string< ::CFStringRef >::operator== ( value_t value)
inlineinherited

◆ operator>() [1/2]

bool dx::cf::__string< ::CFStringRef >::operator> ( ::CFStringRef value) const
inlinenoexceptinherited

◆ operator>() [2/2]

bool dx::cf::__string< ::CFStringRef >::operator> ( value_t value)
inlineinherited

◆ operator>=() [1/2]

bool dx::cf::__string< ::CFStringRef >::operator>= ( ::CFStringRef value) const
inlinenoexceptinherited

◆ operator>=() [2/2]

bool dx::cf::__string< ::CFStringRef >::operator>= ( value_t value)
inlineinherited

◆ release()

template<typename cf_object_t >
reference & dx::cf::reference< cf_object_t >::release ( )
inlinenoexceptinherited
+ Here is the caller graph for this function:

◆ removed()

◆ retain()

template<typename cf_object_t >
reference & dx::cf::reference< cf_object_t >::retain ( )
inlinenoexceptinherited
+ Here is the caller graph for this function:

Member Data Documentation

◆ cf_object

template<typename cf_object_t >
cf_object_t dx::cf::reference< cf_object_t >::cf_object = nullptr
protectedinherited

◆ cf_type_desc

template<typename cf_object_t >
::CFStringRef dx::cf::reference< cf_object_t >::cf_type_desc = nullptr
inherited

◆ cf_type_id

template<typename cf_object_t >
::CFStringRef dx::cf::reference< cf_object_t >::cf_type_id = nullptr
inherited

◆ launched

bool dx::generic::driver::launched = false

◆ log [1/2]

log dx::generic::driver::log {}

◆ log [2/2]

dx::log dx::generic::driver::log {}

◆ preference [1/2]

cf::preference dx::generic::driver::preference

◆ preference [2/2]

dx::registry dx::generic::driver::preference

◆ setup

dx::generic::driver::setup dx::generic::driver::setup

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

(c) copyright 2009 dynamic acoustics e.U. generated on Thu Jun 6 2024

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.