|
dxd - dynax driver framework 2.7.0d222
cross platform open source driver development framework
|
OS proxy device interface class. More...
#include <dx_proxy_device.h>
Classes | |
| class | software |
| Software Device API instance. More... | |
Public Types | |
| typedef shared::event | event_t |
Public Member Functions | |
| void | conclude () noexcept override |
| conclude notifacation: device will be removed from tree | |
| auto | count () const noexcept |
| void | ctl (uint32_t ioctl) const try |
| void | ctl (unsigned int ioctl) const |
| device (decltype(super::driver)&driver, ::io_service_t id) | |
| the device class constructor | |
| device (decltype(super::driver)&driver, const std::string &id, const std::string &puuid={}, const std::string &puid={}) | |
| the device class constructor | |
| dx_catchall_rethrow (, "name: %s, access rights: %x, sharing options:%x", name, access, share) | |
| dx_catchall_rethrow () template< typename rx_t > enable_if_ptr< rx_t > ictl(uint32_t ioctl) const try | |
| dx_catchall_rethrow () template< typename rx_t > enable_if_scalar< rx_t > ictl(uint32_t ioctl) const try | |
| dx_catchall_rethrow () template< typename rx_t > hide_if_scalar_or_ptr< rx_t > ictl(uint32_t ioctl) const try | |
| member ioctl | |
| dx_catchall_rethrow () template< typename rx_t > size_t ictl(uint32_t ioctl | |
| dx_catchall_rethrow () template< typename tx_t | |
| dx_catchall_rethrow () ~device() override | |
| the device class destructor | |
| dx_pass (::IOConnectCallStructMethod(io_connect, ioctl, nullptr, 0, &rx, &size), "%s rx:%p size:%d", fourchar::to::string(ioctl).c_str(), &rx, size) | |
| void | exception (const dx::exception &exception, bool filtered=false) const noexcept override |
| notification exception handler | |
| template<typename value_t, typename = cf::enable_if_convertible<value_t>> | |
| value_t | get (::CFStringRef key) const |
| ::CFTypeRef | get (::CFStringRef key) const |
| template<typename value_t, typename = cf::enable_if_convertible<value_t>> | |
| value_t | get (::CFStringRef key, ::CFTypeRef dflt) const noexcept |
| ::CFTypeRef | get (::CFStringRef key, ::CFTypeRef dflt) const noexcept |
| template<typename value_t, typename = cf::enable_if_convertible<value_t>> | |
| value_t | get (::CFStringRef key, value_t dflt) const noexcept |
| template<typename key_t, typename value_t, typename = cf::enable_if_convertible<key_t>, typename = cf::enable_if_convertible<value_t>> | |
| value_t | get (key_t key) const |
| template<typename key_t, typename = cf::enable_if_convertible<key_t>> | |
| ::CFTypeRef | get (key_t key) const |
| template<typename rx_t> | |
| rx_t | ictl (unsigned int ioctl) const |
| Windows: member ioctl. | |
| template<typename rx_t> | |
| size_t | ictl (unsigned int ioctl, rx_t &rx) const |
| void | info (std::ostream &os) noexcept override |
| log object class information | |
| void | initialize (const char *name, ::DWORD access=GENERIC_READ|GENERIC_WRITE, ::DWORD share=FILE_SHARE_READ|FILE_SHARE_WRITE) try |
| (re-)initialization the underlaying windows API is CreateFile(). for detailed information see http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx | |
| template<typename rx_t, typename tx_t> | |
| rx_t | ioctl (unsigned int ioctl, const tx_t &tx) const |
| template<typename tx_t, typename rx_t> | |
| size_t | ioctl (unsigned int ioctl, const tx_t &tx, rx_t &rx) const |
| void | launch () override |
| launch notification: object mounted and ready to use. Called only through try_launch() - never call this directly from outside the class hierarchy. | |
| template<typename tx_t> | |
| void | octl (unsigned int ioctl, const tx_t &tx) const |
| operator const ::io_registry_entry_t & () const noexcept | |
| auto converter into const io_object | |
| operator const ::io_registry_entry_t & () const noexcept | |
| auto converter into const io_object | |
| operator const os_event () const noexcept | |
| operator const std::string & () const noexcept | |
| identifying device string, mirroring macOS' io::registry conversion | |
| operator os_event () noexcept | |
| operator uint64_t () const | |
| operator::CFMutableDictionaryRef () const | |
| operator::CFStringRef () const | |
| operator::HANDLE () const noexcept | |
| operator::io_registry_entry_t & () noexcept | |
| auto converter into io_object | |
| operator::io_registry_entry_t & () noexcept | |
| auto converter into io_object | |
| operator::io_registry_entry_t * () noexcept | |
| auto converter into io_object pointer | |
| operator::io_registry_entry_t * () noexcept | |
| auto converter into io_object pointer | |
| device & | operator= (::CFTypeRef properties) |
| bool | operator== (::io_registry_entry_t io_object) const noexcept |
| virtual device & | operator>> (std::ostream &) const |
| virtual device & | operator>> (std::ostream &) const |
| ::CFTypeRef | operator[] (::CFStringRef key) const |
| template<typename key_t, typename = cf::enable_if_convertible<key_t>> | |
| ::CFTypeRef | operator[] (key_t key) const |
| registry | parent () const |
| reference & | retain () |
| device & | set (::CFStringRef key, ::CFTypeRef value) noexcept |
| template<typename value_t, typename = cf::enable_if_convertible<value_t>> | |
| device & | set (::CFStringRef key, value_t value) |
| device & | set (::CFTypeRef properties) |
| Setting properties in a registry entry is not generally supported, it is more common to support setting of properties of the connection based property setting of dx::device. | |
| template<typename key_t, typename = cf::enable_if_convertible<key_t>> | |
| device & | set (key_t key, ::CFTypeRef value) |
| template<typename key_t, typename value_t, typename = cf::enable_if_convertible<key_t>, typename = cf::enable_if_convertible<value_t>> | |
| device & | set (key_t key, value_t value) |
| virtual void | sleep () |
| notify system will sleep stub | |
| virtual void | sleep () |
| notify system will sleep stub | |
| bool | try_conclude () noexcept |
| atomically conclude()s if currently launched; returns whether this call did it | |
| bool | try_conclude () noexcept |
| atomically conclude()s if currently launched; returns whether this call did it | |
| bool | try_launch () |
| atomically launch()es if not already launched; returns whether this call did it | |
| bool | try_launch () |
| atomically launch()es if not already launched; returns whether this call did it | |
| virtual void | wake () |
| notify system wake completed stub | |
| virtual void | wake () |
| notify system wake completed stub | |
Static Public Member Functions | |
| template<typename desc_t> | |
| static void | create (const char *product_id, const ::GUID &guid, const std::string &id, const desc_t &desc) |
| persisted software device: PnP keeps it enumerated after the creating handle closes | |
| static void | destroy (const char *product_id, const ::GUID &guid, const std::string &id) |
| re-acquires the persisted device and binds it to the closing handle | |
Public Attributes | |
| dx::driver< decltype(id), preference_t > & | driver |
| dx::driver< decltype(id), preference_t > & | driver |
| const std::string | id |
| const ::io_service_t | id |
| std::atomic< bool > | launched |
| std::atomic< bool > | launched |
| preference_t | preference |
| preference_t | preference |
| std::string | puid |
| persistent UID - system unique - could change with location | |
| std::string | puid |
| persistent UID - system unique - could change with location | |
| std::string | puuid |
| persistent universal UID - universally unique ID (i.e. serial number) | |
| std::string | puuid |
| persistent universal UID - universally unique ID (i.e. serial number) | |
| return | size |
| rx_t &rx const | try |
Protected Types | |
| typedef service::request< service::stream::data< typename super_device_t::desc_t > > | request |
| typedef pipe< request >::template server< user_client, std::weak_ptr< device > > | server |
| pipe::server connecting user_clients The pipe holds a std::weak_ptr<device> as a temporary by the pipe::server::args variadic tuple to create shared device references for the user_client. At time of device construction there is not yet a std::shared_ptr<device>, therefore the pipe::server::args weak_ptr assignment happens at service::device::launch(). | |
| enum class | type : ::DWORD { undefined = REG_NONE , uint32 = REG_DWORD , uint64 = REG_QWORD , string = REG_SZ , vendor = REG_BINARY } |
Protected Member Functions | |
| std::string | canonical (const std::string &name) const try |
| catch (...) | |
| catch (...) | |
| dx_catchall_rethrow () registry(const registry ®istry | |
| registry & | erase (const char *subkey=nullptr) noexcept |
| registry & | initialize (const std::string &key, ::HKEY root=HKEY_CURRENT_USER, ::REGSAM rights=KEY_ALL_ACCESS) try |
| registry & | initialize (const std::string &key, ::REGSAM rights, ::HKEY root, const char *path=nullptr) try |
| virtual void | launch () |
| launch notification: object mounted and ready to use. Called only through try_launch() - never call this directly from outside the class hierarchy. | |
| registry & | run () |
| dx_catchall_rethrow() registry &initialize(size_t | size () const noexcept |
Static Protected Member Functions | |
| static self_t void | assign (const self_t &self, const value_t &value) try |
| template<typename self_t> | |
| static registry | at (const self_t &self) |
| template<typename container_t, typename self_t> | |
| static container_t | children (const self_t &self) noexcept try |
| template<typename value_t, typename self_t> | |
| static bool | fetch (const self_t &self, value_t &value) try |
| template<typename self_t> | |
| static bool | nested (const self_t &self) noexcept |
| template<typename self_t> | |
| static size_t | size (const self_t &self) noexcept |
Protected Attributes | |
| class dx::service::device::promoted | clocksource |
| bool | connected = false |
| ::HANDLE | handle = invalid_t |
| class dx::service::device::promoted | iosize |
| struct { | |
| cf::string bundle_id | |
| cf::string class_name | |
| } | kernel |
| std::string | key |
| const std::string & | key: rights{registry.rights} |
| std::deque< std::function< void()> > | listen |
| const std::string | owns_root |
| class dx::service::device::promoted | pipe |
| server | pipe |
| io::port | port |
| ::HANDLE | process = ::GetCurrentProcess() |
| const std::string | root {registry.root} |
| class dx::service::device::promoted | safety_offset [dx::stream::direction::out] |
| class dx::service::device::promoted | safety_offset_in [dx::stream::direction::in] |
| class dx::service::device::promoted | safety_offset_out [dx::stream::direction::out] |
| class dx::service::device::promoted | samplerate |
| bool | schedule_erase {} |
OS proxy device interface class.
This is the OS proxy device interface class. This class is used for a platform independent way of accessing kernel/driverkit devices. The device class uses the driver interface helper class to construct the device object and to bind the device to the driver identified by the GUID.
example:
| in | case 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_result template parameter the dx::os_result itself will be thrown. |
|
inherited |
|
protectedinherited |
|
protectedinherited |
pipe::server connecting user_clients The pipe holds a std::weak_ptr<device> as a temporary by the pipe::server::args variadic tuple to create shared device references for the user_client. At time of device construction there is not yet a std::shared_ptr<device>, therefore the pipe::server::args weak_ptr assignment happens at service::device::launch().
|
strongprotectedinherited |
|
inline |
the device class constructor
| kIOReturn | NoMemory means that the system couldn't allocate the class defined in the drivers plist, or nub which ever its trying connecting to |
Constructs and open device,
connects notification port and ignores if it failed: It will fail on drivers not providing a notificaion port, like Apple Family drivers.
| driver | device tree hosting dx::driver |
| id | the IOService object to open the device connection for. This will be retained during device class lifetime |
|
inline |
the device class constructor
the underlaying windows API is RegisterDeviceNotification(). for detailed information see http://msdn.microsoft.com/en-us/library/windows/desktop/aa363431(v=vs.85).aspx
| n/a | microsoft does not give information about what possible errors values are provided by its OS |
|
inlinestaticprotectedinherited |
|
inlinestaticprotectedinherited |
dx::key_value_tree<registry> contract: resolves self's parent chain into one real key/value position, then delegates below - the only place a registry[k1][k2]..[kN] chain becomes real subkeys/values.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlinestaticprotectednoexceptinherited |
self's own child names as any string container, yielding an empty one when the key is absent or inaccessible. Stays a static, not a dx::key_value_tree-style operator container_t(): registry is a dependent base of key_value_tree<registry> (inherited via the tree_t template parameter), and key_value_tree's own operator value_t() becomes entirely unreachable once a dependent base declares a same-shaped operator container_t() template of its own.
|
inlineoverridevirtualnoexcept |
conclude notifacation: device will be removed from tree
Reimplemented from dx::object.
Reimplemented in dx::proxy::stream::_device< dx::stream::desc<>, dx::preference, stream< device< dx::stream::desc<>, dx::preference, stream > > >.
|
inlinenoexceptinherited |
|
inlinestatic |
persisted software device: PnP keeps it enumerated after the creating handle closes
|
inline |
|
inline |
|
inlinestatic |
re-acquires the persisted device and binds it to the closing handle
|
inherited |
|
inline |
|
inline |
|
inline |
member ioctl
this member retreives data from the device by providing an IOCTL code. the template argument defines the type of data to be retreived. this member is intended as a convinient way to retreive only small amounts of data since there is an intermediate stack copy involved in returning the data.
| dx::proxy::device< preference_t >::dx_catchall_rethrow | ( | ) |
| dx::proxy::device< preference_t >::dx_catchall_rethrow | ( | ) |
|
inlineoverride |
the device class destructor
the underlaying IOKit API is IOServiceClose().
remark: The io_service reference itself is managed by inherited io::reference
for detailed information see
Disconnect notification port,
closes the connection to the IOService object
|
protectedinherited |
cheap: purely in-memory identity extension with a bare child name - what dx::key_value_tree::operator[] builds on.
| dx::proxy::device< preference_t >::dx_pass | ( | ::IOConnectCallStructMethod(io_connect, ioctl, nullptr, 0, &rx, &size) | , |
| "%s rx:%p size:%d" | , | ||
| fourchar::to::string(ioctl).c_str() | , | ||
| & | rx, | ||
| size | ) |
|
inlineprotectednoexceptinherited |
|
inlineoverridevirtualnoexcept |
notification exception handler
Reimplemented from dx::device<::io_service_t, preference_t >.
Reimplemented in dx::usb::platform::device< preference_t >, dx::usb::platform::device< dx::preference >, and dx::usb::platform::device< preference_t >.
|
inlinestaticprotectedinherited |
|
inlineinherited |
|
inlineinherited |
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
Windows: member ioctl.
this member retreives data from the device by providing an IOCTL code. the template argument defines the type of data to be retreived. this member is intended as a convinient way to retreive only small amounts of data since there is an intermediate stack copy involved in returning the data.
the underlaying windows API is DeviceIoControl(). for detailed information see http://msdn.microsoft.com/en-us/library/aa363216(VS.85).aspx
| n/a | microsoft does not give information about what possible errors values are provided by its OS other than |
| ERROR_INSUFFICIENT_BUFFER | if the output buffer is too small to receive any data |
| rx_t | type of rx_t needs to be explicitly specified as it can't be deduced |
|
inline |
|
inlineoverridevirtualnoexcept |
log object class information
Reimplemented from dx::device<::io_service_t, preference_t >.
Reimplemented in dx::proxy::stream::_device< dx::stream::desc<>, dx::preference, stream< device< dx::stream::desc<>, dx::preference, stream > > >, dx::stream::control< dx::proxy::device< dx::preference > >, dx::stream::control< usb::device< dx::preference > >, dx::stream::device< dx::stream::control< dx::proxy::device< dx::preference > >, dx::stream::desc<>, stream< device< dx::stream::desc<>, dx::preference, stream > > >, dx::stream::device< dx::stream::control< usb::device< dx::preference > >, desc_t, pipe< device< desc_t, dx::preference, pipe > > >, dx::usb::platform::device< preference_t >, dx::usb::platform::device< dx::preference >, dx::usb::platform::device< preference_t >, and dx::usb::stream::_device< desc_t, dx::preference, pipe< device< desc_t, dx::preference, pipe > > >.
|
inlineinherited |
(re-)initialization the underlaying windows API is CreateFile(). for detailed information see http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx
| n/a | microsoft does not give information about what possible errors values are provided by its OS |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inline |
|
inline |
|
inlineprotectedvirtualinherited |
launch notification: object mounted and ready to use. Called only through try_launch() - never call this directly from outside the class hierarchy.
|
inlineoverridevirtualinherited |
launch notification: object mounted and ready to use. Called only through try_launch() - never call this directly from outside the class hierarchy.
Reimplemented from dx::object.
Reimplemented in dx::usb::stream::_device< desc_t, dx::preference, pipe< device< desc_t, dx::preference, pipe > > >.
|
inlinestaticprotectednoexceptinherited |
|
inline |
|
inlinenoexceptinherited |
auto converter into const io_object
|
inlinenoexceptinherited |
auto converter into const io_object
|
inlinenoexceptinherited |
|
inlinenoexcept |
identifying device string, mirroring macOS' io::registry conversion
|
inlinenoexceptinherited |
|
inlineexplicitinherited |
|
inlineexplicitinherited |
|
inlineexplicitinherited |
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
auto converter into io_object
|
inlinenoexceptinherited |
auto converter into io_object
|
inlinenoexceptinherited |
auto converter into io_object pointer
|
inlinenoexceptinherited |
auto converter into io_object pointer
|
inline |
|
inlinenoexceptinherited |
|
inlinevirtualinherited |
|
inlinevirtualinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineprotectedinherited |
|
inlinenoexcept |
|
inline |
|
inline |
Setting properties in a registry entry is not generally supported, it is more common to support setting of properties of the connection based property setting of dx::device.
|
inline |
|
inline |
|
inlineprotectednoexceptinherited |
stays a named method: base and derived conversion function templates are simultaneous overload candidates, so an operator value_t() here would compete with dx::key_value_tree's own. like get<value_t>() but returns false for ERROR_FILE_NOT_FOUND, from either RegQueryValueExA or value_of() itself; any other failure throws. a sibling thread/process may delete the containing key between value_of()'s create and the set - retry recreates the whole chain in that case subkey+value count, 0 if the key doesn't exist (key_of()'s non-throwing overload - an ordinary, expected outcome here, not a genuine error).
|
inlinestaticprotectednoexceptinherited |
|
inlinevirtualinherited |
notify system will sleep stub
|
inlinevirtualinherited |
notify system will sleep stub
|
inlinenoexceptinherited |
atomically conclude()s if currently launched; returns whether this call did it
|
inlinenoexceptinherited |
atomically conclude()s if currently launched; returns whether this call did it
|
inlineinherited |
atomically launch()es if not already launched; returns whether this call did it
|
inlineinherited |
atomically launch()es if not already launched; returns whether this call did it
|
inlinevirtualinherited |
notify system wake completed stub
|
inlinevirtualinherited |
notify system wake completed stub
|
inherited |
|
protectedinherited |
|
protected |
|
inherited |
|
inherited |
|
protectedinherited |
|
inherited |
|
inherited |
|
protectedinherited |
| struct { ... } dx::service::device< preference_t >::kernel |
|
protectedinherited |
|
protectedinherited |
|
inherited |
|
inherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
inherited |
|
inherited |
|
protectedinherited |
|
inherited |
persistent UID - system unique - could change with location
|
inherited |
persistent UID - system unique - could change with location
|
inherited |
persistent universal UID - universally unique ID (i.e. serial number)
|
inherited |
persistent universal UID - universally unique ID (i.e. serial number)
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
| return dx::proxy::device< preference_t >::size |
| rx_t& rx const dx::proxy::device< preference_t >::try |
| (c) copyright 2009 dynamic acoustics e.U. | generated on |