dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::proxy::device< preference_t > Class Template Reference

OS proxy device driver interface class. More...

#include <dx_proxy_device.h>

Inheritance diagram for dx::proxy::device< preference_t >:
Collaboration diagram for dx::proxy::device< preference_t >:

Classes

class  software
 Software Device API instance. More...

Public Types

typedef std::set<std::string> keys
enum class  type : ::DWORD {
  undefined = REG_NONE , uint32 = REG_DWORD , uint64 = REG_QWORD , string = REG_SZ ,
  vendor = REG_BINARY
}
 the value types this store keeps - a scalar rides as REG_DWORD/REG_QWORD rather than as a byte copy, so a value written here reads like any other in the registry editor More...

Public Member Functions

 catch(...)
 catch(...)
void conclude() noexcept override
 conclude notification: object will be removed. If you overwrite conclude() you also need to overwrite destructor and check if its needed to be called from there. Called only through try_conclude() - never call this directly from outside the class hierarchy.
void conclude() noexcept override
 conclude notifacation: device will be removed from tree
auto count() const noexcept
void ctl(uint32_t ioctl) const
void ctl(unsigned int ioctl) const
 device(decltype(super::driver)& driver, ::io_service_t id, const std::pair<std::string, std::string>& identity= {})
 the device class constructor
 device(decltype(super::driver)& driver, const std::string& id, const std::pair<std::string, std::string>& identity= {})
 the device class constructor
registry& erase(const char* subkey= nullptr) noexcept
void exception(const dx::exception& exception, bool filtered= false) const noexcept override
 notification exception handler
void exception(const dx::exception& exception, bool filtered= false) const noexcept override
 notification exception handler
virtual void free() noexcept
template<typename value_t>
value_t get() const
template<typename value_t>
bool get(value_t& value) const
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>
enable_if_ptr<rx_t> ictl(uint32_t ioctl) const
template<typename rx_t>
enable_if_scalar<rx_t> ictl(uint32_t ioctl) const
template<typename rx_t>
hide_if_scalar_or_ptr<rx_t> ictl(uint32_t ioctl) const
 member ioctl
template<typename rx_t>
size_t ictl(uint32_t ioctl, rx_t& rx) 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 initialize(const char* name, ::DWORD access= GENERIC_READ|GENERIC_WRITE, ::DWORD share= FILE_SHARE_READ|FILE_SHARE_WRITE)
 (re-)initialization the underlaying windows API is CreateFile(). for detailed information see http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx
registry& initialize(::HKEY root, ::REGSAM rights= KEY_ALL_ACCESS)
registry& initialize(::REGSAM rights= KEY_ALL_ACCESS, ::HKEY root= HKEY_CURRENT_USER)
registry& initialize(const std::string& key, ::HKEY root= HKEY_CURRENT_USER, ::REGSAM rights= KEY_ALL_ACCESS)
template<typename rx_t, typename tx_t>
rx_t ioctl(uint32_t ioctl, const tx_t& tx) const
template<typename rx_t, typename tx_t>
size_t ioctl(uint32_t ioctl, const tx_t& tx, rx_t& rx) const
template<typename rx_t, typename tx_t>
size_t ioctl(uint32_t ioctl, const tx_t& tx, rx_t& rx, const dx::os_event& eventevent) const
size_t ioctl(uint32_t ioctl, const void* tx= nullptr, size_t tx_size= 0, void* rx= nullptr, size_t rx_size= 0) const
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
template<typename rx_t, typename tx_t>
size_t ioctl(unsigned int ioctl, const tx_t& tx, rx_t& rx, const os_event &) const
size_t ioctl(unsigned int ioctl, const void* tx= nullptr, size_t tx_size= 0, void* rx= nullptr, size_t rx_size= 0) const
 raw buffers, as on macOS: what the driver answered, its size
void launch() override
 the listener registered with the driver, then every value read back: a change ahead of the registration is not lost
void launch() override
 the listener registered with the driver, then every value read back: a change ahead of the registration is not lost
template<typename rx_t>
rx_t* map(uint32_t typetype) const
 maps the memory the given type names into this client
template<typename rx_t>
rx_t* map(uint32_t) const
 a WDM driver maps into its client itself and answers with the pointer, so a type is never mapped here
template<typename tx_t, typename= hide_if_ptr<tx_t>>
device& octl(uint32_t ioctl, const tx_t& tx)
template<typename tx_t, typename= hide_if_ptr<tx_t>>
device& octl(uint32_t ioctl, const tx_t& tx, const dx::os_event& eventevent)
 an IOCTL registering an event: the async form, whose completion the driver keeps to signal it
template<typename tx_t, typename= enable_if_ptr<tx_t>>
device& octl(uint32_t ioctl, const tx_t tx)
template<typename tx_t>
void octl(unsigned int ioctl, const tx_t& tx) const
template<typename tx_t>
void octl(unsigned int ioctl, const tx_t& tx, const os_event &) const
 an IOCTL registering an event: the handle in the payload is what the driver references, the plain call serves
 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 ::HKEY() 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
 the device's own diagnostics, beyond its operator <<
virtual device& operator >>(std::ostream &) const
 the device's own diagnostics, beyond its operator <<
::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
device& reenumerate()
 the device leaves its bus and enumerates again, its kernel driver taking a surprise removal - where the kernel driver's bus offers it
device& reenumerate()
 the device leaves its bus and enumerates again, its kernel driver taking a surprise removal - where the kernel driver's bus offers it
reference& retain()
registry& run()
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)
registry& set(::DWORD typetype, const void* value, size_t size)
size_t size() const noexcept
virtual void sleep()
 notify system will sleep stub
virtual void sleep()
 notify system will sleep stub
std::string string(uint8_t) const
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. A launch() that throws is concluded before the exception leaves: the object never claims a launch it did not finish
bool try_launch()
 atomically launch()es if not already launched; returns whether this call did it. A launch() that throws is concluded before the exception leaves: the object never claims a launch it did not finish
type type() const noexcept
template<typename rx_t>
const device& unmap(uint32_t typetype, rx_t* rx) const
template<typename rx_t>
const device& unmap(uint32_t, rx_t *) const
virtual void wake()
 notify system wake completed stub
virtual void wake()
 notify system wake completed stub
 ~device() override
 the device class destructor

Static Public Member Functions

template<typename value_t, typename self_t>
static void assign(const self_t& self, const value_t& value)
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
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; PnP keeps the removed device's node as a phantom, uninstalled here
template<typename value_t, typename self_t>
static bool fetch(const self_t& self, value_t& value)
template<typename self_t>
static bool nested(const self_t& self) noexcept
template<typename self_t>
static void purge(const self_t& self) noexcept
template<typename self_t>
static size_t size(const self_t& self) noexcept

Public Attributes

dx::listen<std::function<void()>> broadcast
 the driver's values mirrored here that listen: each reads itself back where it stands initialized
dx::driver<decltype(id), preference_t>& driver
dx::driver<decltype(id), preference_t>& driver
const std::string id
const ::io_service_t id
std::string key
std::atomic<bool> launched
std::atomic<bool> launched
std::deque<std::function<void()>> listen
event listener
 this client's listener on the driver's values: every change it signals reads them back
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)
bool schedule_erase{}

Protected Member Functions

std::string canonical(const std::string& name) const
registry& initialize(const std::string& key, ::REGSAM rights, ::HKEY root, const char* path= nullptr)

Protected Attributes

bool connected= false
::HANDLE handle{invalid_t}
struct dx::registry::device:: { ... }  kernel
io::port port
::HANDLE process{::GetCurrentProcess()}

Detailed Description

template<typename preference_t>
class dx::proxy::device< preference_t >

OS proxy device driver interface class.

OS proxy driver interface class.

OS proxy device interface class.

This is the specific device interface to a driver identified by a matching IDs. The driver class is a helper to create device objects and to bind the device to the driver identified by the product ID.

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

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:

try() { // guard the block
// choose a driver
// enumerate devices
std::cout<< driver.size()<< " device(s) found:"<< std::endl;
// go thru all devices; you have to lock the driver if this multi-threaded
for (auto device: driver){
// return an int32_t from an IOCTL served by the driver
int32_t my_data{device.ioctl<int32_t>(kMyIoctl)};
}
} cd_catchall()
dx::driver< decltype(id), preference_t > & driver
Definition dx_device.h:54
device(decltype(super::driver)&driver, ::io_service_t id, const std::pair< std::string, std::string > &identity={})
the device class constructor
Definition macOS/proxy/dx_proxy_device.h:188
Definition macOS/proxy/dx_proxy_driver.h:56
which devices a bus takes: any of its dictionaries whose every verb the device states alike,...
Definition dx_match.h:72
int int32_t
Definition wdm/dxd_platform.h:116
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_result template parameter the dx::os_result itself will be thrown.

This is the specific device interface to a driver identified by a matching IDs. The driver class is a helper to create device objects and to bind the device to the driver identified by the product GUID.

Exceptions
incase of an error returned by the underlaying API the driver class throws a dx::exception.
Todo
distinguish between "driver not installed" and "no device"

Member Typedef Documentation

◆ keys

typedef std::set<std::string> dx::registry::keys
inherited

Member Enumeration Documentation

◆ type

enum class dx::registry::type : ::DWORD
stronginherited

the value types this store keeps - a scalar rides as REG_DWORD/REG_QWORD rather than as a byte copy, so a value written here reads like any other in the registry editor

Enumerator
undefined 
uint32 
uint64 
string 
vendor 

Constructor & Destructor Documentation

◆ device() [1/2]

template<typename preference_t>
dx::proxy::device<preference_t>::device(decltype(super::driver)& driver, ::io_service_t id, const std::pair<std::string, std::string>& identity= {})
inline

the device class constructor

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

Todo
proxy::device: find a way to set notification port only propratary DriverKit devices and except on failure to do so.
Parameters
driverdevice tree hosting dx::driver
idthe IOService object to open the device connection for. This will be retained during device class lifetime
Here is the caller graph for this function:

◆ ~device()

template<typename preference_t>
dx::proxy::device<preference_t>::~device()
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

Here is the call graph for this function:

◆ device() [2/2]

template<typename preference_t>
dx::proxy::device<preference_t>::device(decltype(super::driver)& driver, const std::string& id, const std::pair<std::string, std::string>& identity= {})
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

Exceptions
n/amicrosoft does not give information about what possible errors values are provided by its OS

Member Function Documentation

◆ assign()

template<typename value_t, typename self_t>
void dx::registry::assign(const self_t& self, const value_t& value)
inlinestaticinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ at()

template<typename self_t>
registry dx::registry::at(const self_t& self)
inlinestaticinherited

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ canonical()

std::string dx::registry::canonical(const std::string& name) const
inlineprotectedinherited
Here is the caller graph for this function:

◆ catch() [1/2]

dx::registry::catch(...)
inlineinherited

◆ catch() [2/2]

dx::registry::catch(...)
inlineinherited

◆ children()

template<typename container_t, typename self_t>
container_t dx::registry::children(const self_t& self)
inlinestaticnoexceptinherited

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.

Here is the call graph for this function:

◆ conclude() [1/2]

template<typename preference_t>
void dx::proxy::device<preference_t>::conclude()
inlineoverridevirtualnoexcept

conclude notification: object will be removed. If you overwrite conclude() you also need to overwrite destructor and check if its needed to be called from there. Called only through try_conclude() - never call this directly from outside the class hierarchy.

Reimplemented from dx::object.

Reimplemented in dx::proxy::stream::_device< dx::stream::desc<>, dx::preference, stream< device< dx::stream::desc<>, dx::preference, stream, group, dx::proxy::device< dx::preference > > >, group< device< dx::stream::desc<>, dx::preference, stream, group, dx::proxy::device< dx::preference > > >, dx::proxy::device< dx::preference > >, dx::stream::device< dx::proxy::device< dx::preference >, dx::stream::desc<>, stream< device< dx::stream::desc<>, dx::preference, stream, group, dx::proxy::device< dx::preference > > >, group< device< dx::stream::desc<>, dx::preference, stream, group, dx::proxy::device< dx::preference > > > >, dx::stream::device< usb::device< dx::preference >, desc_t, pipe< device< desc_t, dx::preference, pipe, group > >, group< device< desc_t, dx::preference, pipe, group > > >, dx::stream::device< usb::device< preference_t >, desc_t, stream_t, group_t >, dx::usb::device< preference_t >, dx::usb::device< dx::preference >, dx::usb::platform::device< preference_t >, dx::usb::platform::device< dx::preference >, and dx::usb::platform::device< preference_t >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ conclude() [2/2]

template<typename preference_t>
void dx::proxy::device<preference_t>::conclude()
inlineoverridevirtualnoexcept

conclude notifacation: device will be removed from tree

Reimplemented from dx::object.

Reimplemented in dx::usb::platform::device< preference_t >.

Here is the call graph for this function:

◆ count()

auto io::reference<::io_registry_entry_t>::count() const
inlinenoexceptinherited

◆ create()

template<typename preference_t>
template<typename desc_t>
void dx::proxy::device<preference_t>::create(const char* product_id, const ::GUID& guid, const std::string& id, const desc_t& desc)
inlinestatic

persisted software device: PnP keeps it enumerated after the creating handle closes

Here is the call graph for this function:

◆ ctl() [1/2]

template<typename preference_t>
void dx::proxy::device<preference_t>::ctl(uint32_t ioctl) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ctl() [2/2]

template<typename preference_t>
void dx::proxy::device<preference_t>::ctl(unsigned int ioctl) const
inline
Here is the call graph for this function:

◆ destroy()

template<typename preference_t>
void dx::proxy::device<preference_t>::destroy(const char* product_id, const ::GUID& guid, const std::string& id)
inlinestatic

re-acquires the persisted device and binds it to the closing handle; PnP keeps the removed device's node as a phantom, uninstalled here

Here is the call graph for this function:

◆ erase()

registry& dx::registry::erase(const char* subkey= nullptr)
inlinenoexceptinherited
Here is the call graph for this function:

◆ exception() [1/2]

template<typename preference_t>
void dx::proxy::device<preference_t>::exception(const dx::exception& exception, bool filtered= false) const
inlineoverridevirtualnoexcept

notification exception handler

Reimplemented from dx::device<::io_service_t, preference_t >.

Reimplemented in dx::usb::device< preference_t >, dx::usb::device< dx::preference >, dx::usb::platform::device< preference_t >, dx::usb::platform::device< preference_t >, dx::usb::platform::device< dx::preference >, dx::usb::platform::device< preference_t >, and dx::usb::platform::device< preference_t >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exception() [2/2]

template<typename preference_t>
void dx::proxy::device<preference_t>::exception(const dx::exception& exception, bool filtered= false) const
inlineoverridevirtualnoexcept

notification exception handler

Reimplemented from dx::device<::io_service_t, preference_t >.

Reimplemented in dx::usb::platform::device< preference_t >, and dx::usb::platform::device< preference_t >.

Here is the call graph for this function:

◆ fetch()

template<typename value_t, typename self_t>
bool dx::registry::fetch(const self_t& self, value_t& value)
inlinestaticinherited

a value that serializes itself into a tree node recurses through its own named children; only what has no such serialization reaches the flat position below, where a struct would become one opaque REG_BINARY of its layout

Here is the call graph for this function:

◆ free()

◆ get() [1/9]

template<typename value_t>
value_t dx::registry::get() const
inlineinherited

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get() [2/9]

template<typename value_t>
bool dx::registry::get(value_t& value) const
inlineinherited

like get<value_t>() but returns false for ERROR_FILE_NOT_FOUND, from either RegQueryValueExA or value_of() itself; any other failure throws.

Here is the call graph for this function:

◆ get() [3/9]

template<typename value_t, typename= cf::enable_if_convertible<value_t>>
value_t io::registry::get(::CFStringRef key) const
inlineinherited
Here is the call graph for this function:

◆ get() [4/9]

::CFTypeRef io::registry::get(::CFStringRef key) const
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get() [5/9]

template<typename value_t, typename= cf::enable_if_convertible<value_t>>
value_t io::registry::get(::CFStringRef key, ::CFTypeRef dflt) const
inlinenoexceptinherited
Here is the call graph for this function:

◆ get() [6/9]

::CFTypeRef io::registry::get(::CFStringRef key, ::CFTypeRef dflt) const
inlinenoexceptinherited
Here is the call graph for this function:

◆ get() [7/9]

template<typename value_t, typename= cf::enable_if_convertible<value_t>>
value_t io::registry::get(::CFStringRef key, value_t dflt) const
inlinenoexceptinherited
Here is the call graph for this function:

◆ get() [8/9]

template<typename key_t, typename value_t, typename= cf::enable_if_convertible<key_t>, typename= cf::enable_if_convertible<value_t>>
value_t io::registry::get(key_t key) const
inlineinherited
Here is the call graph for this function:

◆ get() [9/9]

template<typename key_t, typename= cf::enable_if_convertible<key_t>>
::CFTypeRef io::registry::get(key_t key) const
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ictl() [1/6]

template<typename preference_t>
template<typename rx_t>
enable_if_ptr<rx_t> dx::proxy::device<preference_t>::ictl(uint32_t ioctl) const
inline
Here is the call graph for this function:

◆ ictl() [2/6]

template<typename preference_t>
template<typename rx_t>
enable_if_scalar<rx_t> dx::proxy::device<preference_t>::ictl(uint32_t ioctl) const
inline
Here is the call graph for this function:

◆ ictl() [3/6]

template<typename preference_t>
template<typename rx_t>
hide_if_scalar_or_ptr<rx_t> dx::proxy::device<preference_t>::ictl(uint32_t ioctl) const
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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ictl() [4/6]

template<typename preference_t>
template<typename rx_t>
size_t dx::proxy::device<preference_t>::ictl(uint32_t ioctl, rx_t& rx) const
inline
Here is the call graph for this function:

◆ ictl() [5/6]

template<typename preference_t>
template<typename rx_t>
rx_t dx::proxy::device<preference_t>::ictl(unsigned int ioctl) const
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

Exceptions
n/amicrosoft does not give information about what possible errors values are provided by its OS other than
ERROR_INSUFFICIENT_BUFFERif the output buffer is too small to receive any data
Template Parameters
rx_ttype of rx_t needs to be explicitly specified as it can't be deduced
Here is the call graph for this function:

◆ ictl() [6/6]

template<typename preference_t>
template<typename rx_t>
size_t dx::proxy::device<preference_t>::ictl(unsigned int ioctl, rx_t& rx) const
inline
Here is the call graph for this function:

◆ initialize() [1/5]

void dx::file::initialize(const char* name, ::DWORD access= GENERIC_READ| GENERIC_WRITE, ::DWORD share= FILE_SHARE_READ| FILE_SHARE_WRITE)
inlineinherited

(re-)initialization the underlaying windows API is CreateFile(). for detailed information see http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx

Exceptions
n/amicrosoft does not give information about what possible errors values are provided by its OS
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize() [2/5]

registry& dx::registry::initialize(::HKEY root, ::REGSAM rights= KEY_ALL_ACCESS)
inlineinherited
Here is the call graph for this function:

◆ initialize() [3/5]

registry& dx::registry::initialize(::REGSAM rights= KEY_ALL_ACCESS, ::HKEY root= HKEY_CURRENT_USER)
inlineinherited
Here is the call graph for this function:

◆ initialize() [4/5]

registry& dx::registry::initialize(const std::string& key, ::HKEY root= HKEY_CURRENT_USER, ::REGSAM rights= KEY_ALL_ACCESS)
inlineinherited
Here is the call graph for this function:

◆ initialize() [5/5]

registry& dx::registry::initialize(const std::string& key, ::REGSAM rights, ::HKEY root, const char* path= nullptr)
inlineprotectedinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioctl() [1/8]

template<typename preference_t>
template<typename rx_t, typename tx_t>
rx_t dx::proxy::device<preference_t>::ioctl(uint32_t ioctl, const tx_t& tx) const
inline
Here is the call graph for this function:

◆ ioctl() [2/8]

template<typename preference_t>
template<typename rx_t, typename tx_t>
size_t dx::proxy::device<preference_t>::ioctl(uint32_t ioctl, const tx_t& tx, rx_t& rx) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioctl() [3/8]

template<typename preference_t>
template<typename rx_t, typename tx_t>
size_t dx::proxy::device<preference_t>::ioctl(uint32_t ioctl, const tx_t& tx, rx_t& rx, const dx::os_event& event) const
inline
Here is the call graph for this function:

◆ ioctl() [4/8]

template<typename preference_t>
size_t dx::proxy::device<preference_t>::ioctl(uint32_t ioctl, const void* tx= nullptr, size_t tx_size= 0, void* rx= nullptr, size_t rx_size= 0) const
inline
Here is the call graph for this function:

◆ ioctl() [5/8]

template<typename preference_t>
template<typename rx_t, typename tx_t>
rx_t dx::proxy::device<preference_t>::ioctl(unsigned int ioctl, const tx_t& tx) const
inline
Here is the call graph for this function:

◆ ioctl() [6/8]

template<typename preference_t>
template<typename tx_t, typename rx_t>
size_t dx::proxy::device<preference_t>::ioctl(unsigned int ioctl, const tx_t& tx, rx_t& rx) const
inline
Here is the call graph for this function:

◆ ioctl() [7/8]

template<typename preference_t>
template<typename rx_t, typename tx_t>
size_t dx::proxy::device<preference_t>::ioctl(unsigned int ioctl, const tx_t& tx, rx_t& rx, const os_event&) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioctl() [8/8]

template<typename preference_t>
size_t dx::proxy::device<preference_t>::ioctl(unsigned int ioctl, const void* tx= nullptr, size_t tx_size= 0, void* rx= nullptr, size_t rx_size= 0) const
inline

raw buffers, as on macOS: what the driver answered, its size

Here is the call graph for this function:

◆ launch() [1/2]

template<typename preference_t>
void dx::proxy::device<preference_t>::launch()
inlineoverridevirtual

the listener registered with the driver, then every value read back: a change ahead of the registration is not lost

Reimplemented from dx::object.

Reimplemented in dx::usb::stream::_device< desc_t, preference_t, stream_t, group_t >, dx::usb::stream::_device< desc_t, dx::preference, pipe< device< desc_t, dx::preference, pipe, group > >, group< device< desc_t, dx::preference, pipe, group > > >, and dx::usb::stream::_device< desc_t, preference_t, stream_t< device< desc_t, preference_t, stream_t, group_t > >, group_t< device< desc_t, preference_t, stream_t, group_t > > >.

Here is the call graph for this function:

◆ launch() [2/2]

template<typename preference_t>
void dx::proxy::device<preference_t>::launch()
inlineoverridevirtual

the listener registered with the driver, then every value read back: a change ahead of the registration is not lost

Reimplemented from dx::object.

Here is the call graph for this function:

◆ map() [1/2]

template<typename preference_t>
template<typename rx_t>
rx_t* dx::proxy::device<preference_t>::map(uint32_t type) const
inline

maps the memory the given type names into this client

DriverKit maps into the dext, never into its client: what a WDM driver hands back as a pointer is fetched here, with the type the driver answers in IOUserClient::CopyClientMemoryForType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ map() [2/2]

template<typename preference_t>
template<typename rx_t>
rx_t* dx::proxy::device<preference_t>::map(uint32_t) const
inline

a WDM driver maps into its client itself and answers with the pointer, so a type is never mapped here

◆ nested()

template<typename self_t>
bool dx::registry::nested(const self_t& self)
inlinestaticnoexceptinherited
Here is the call graph for this function:

◆ octl() [1/5]

template<typename preference_t>
template<typename tx_t, typename= hide_if_ptr<tx_t>>
device& dx::proxy::device<preference_t>::octl(uint32_t ioctl, const tx_t& tx)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ octl() [2/5]

template<typename preference_t>
template<typename tx_t, typename= hide_if_ptr<tx_t>>
device& dx::proxy::device<preference_t>::octl(uint32_t ioctl, const tx_t& tx, const dx::os_event& event)
inline

an IOCTL registering an event: the async form, whose completion the driver keeps to signal it

The payload's os_event is the callback/reference pair the async reference carries, delivered on this device's notification port.

Here is the call graph for this function:

◆ octl() [3/5]

template<typename preference_t>
template<typename tx_t, typename= enable_if_ptr<tx_t>>
device& dx::proxy::device<preference_t>::octl(uint32_t ioctl, const tx_t tx)
inline
Here is the call graph for this function:

◆ octl() [4/5]

template<typename preference_t>
template<typename tx_t>
void dx::proxy::device<preference_t>::octl(unsigned int ioctl, const tx_t& tx) const
inline
Here is the call graph for this function:

◆ octl() [5/5]

template<typename preference_t>
template<typename tx_t>
void dx::proxy::device<preference_t>::octl(unsigned int ioctl, const tx_t& tx, const os_event&) const
inline

an IOCTL registering an event: the handle in the payload is what the driver references, the plain call serves

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator const ::io_registry_entry_t &() [1/2]

io::reference<::io_registry_entry_t>::operator const ::io_registry_entry_t&() const
inlinenoexceptinherited

auto converter into const io_object

◆ operator const ::io_registry_entry_t &() [2/2]

io::reference<::io_registry_entry_t>::operator const ::io_registry_entry_t&() const
inlinenoexceptinherited

auto converter into const io_object

◆ operator const os_event()

template<::HANDLE invalid_t= INVALID_HANDLE_VALUE>
dx::resource<invalid_t>::operator const os_event() const
inlinenoexceptinherited

◆ operator const std::string &()

template<typename preference_t>
dx::proxy::device<preference_t>::operator const std::string&() const
inlinenoexcept

identifying device string, mirroring macOS' io::registry conversion

◆ operator os_event()

template<::HANDLE invalid_t= INVALID_HANDLE_VALUE>
dx::resource<invalid_t>::operator os_event()
inlinenoexceptinherited

◆ operator uint64_t()

io::registry::operator uint64_t() const
inlineexplicitinherited

◆ operator ::CFMutableDictionaryRef()

io::registry::operator ::CFMutableDictionaryRef() const
inlineexplicitinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator ::CFStringRef()

io::registry::operator ::CFStringRef() const
inlineexplicitinherited
Here is the caller graph for this function:

◆ operator ::HANDLE()

template<::HANDLE invalid_t= INVALID_HANDLE_VALUE>
dx::resource<invalid_t>::operator ::HANDLE() const
inlinenoexceptinherited
Here is the caller graph for this function:

◆ operator ::HKEY()

dx::registry::operator ::HKEY() const
inlinenoexceptinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator ::io_registry_entry_t &() [1/2]

io::reference<::io_registry_entry_t>::operator ::io_registry_entry_t&()
inlinenoexceptinherited

auto converter into io_object

◆ operator ::io_registry_entry_t &() [2/2]

io::reference<::io_registry_entry_t>::operator ::io_registry_entry_t&()
inlinenoexceptinherited

auto converter into io_object

◆ operator ::io_registry_entry_t *() [1/2]

io::reference<::io_registry_entry_t>::operator ::io_registry_entry_t*()
inlinenoexceptinherited

auto converter into io_object pointer

◆ operator ::io_registry_entry_t *() [2/2]

io::reference<::io_registry_entry_t>::operator ::io_registry_entry_t*()
inlinenoexceptinherited

auto converter into io_object pointer

◆ operator =()

template<typename preference_t>
device& dx::proxy::device<preference_t>::operator =(::CFTypeRef properties)
inline
Here is the call graph for this function:

◆ operator ==()

bool io::reference<::io_registry_entry_t>::operator ==(::io_registry_entry_t io_object) const
inlinenoexceptinherited

◆ operator >>() [1/2]

virtual device& dx::device<std::string, preference_t>::operator >>(std::ostream&) const
inlinevirtualinherited

the device's own diagnostics, beyond its operator <<

◆ operator >>() [2/2]

virtual device& dx::device<::io_service_t, preference_t>::operator >>(std::ostream&) const
inlinevirtualinherited

the device's own diagnostics, beyond its operator <<

Here is the call graph for this function:

◆ operator []() [1/2]

::CFTypeRef io::registry::operator [](::CFStringRef key) const
inlineinherited
Here is the call graph for this function:

◆ operator []() [2/2]

template<typename key_t, typename= cf::enable_if_convertible<key_t>>
::CFTypeRef io::registry::operator [](key_t key) const
inlineinherited
Here is the call graph for this function:

◆ parent()

registry io::registry::parent() const
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ purge()

template<typename self_t>
void dx::registry::purge(const self_t& self)
inlinestaticnoexceptinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reenumerate() [1/2]

template<typename preference_t>
device& dx::proxy::device<preference_t>::reenumerate()
inline

the device leaves its bus and enumerates again, its kernel driver taking a surprise removal - where the kernel driver's bus offers it

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reenumerate() [2/2]

template<typename preference_t>
device& dx::proxy::device<preference_t>::reenumerate()
inline

the device leaves its bus and enumerates again, its kernel driver taking a surprise removal - where the kernel driver's bus offers it

Here is the call graph for this function:

◆ retain()

reference& io::reference<::io_registry_entry_t>::retain()
inlineinherited
Here is the caller graph for this function:

◆ run()

registry& dx::registry::run()
inlineinherited
Here is the call graph for this function:

◆ set() [1/6]

template<typename preference_t>
device& dx::proxy::device<preference_t>::set(::CFStringRef key, ::CFTypeRef value)
inlinenoexcept
Here is the call graph for this function:

◆ set() [2/6]

template<typename preference_t>
template<typename value_t, typename= cf::enable_if_convertible<value_t>>
device& dx::proxy::device<preference_t>::set(::CFStringRef key, value_t value)
inline
Here is the call graph for this function:

◆ set() [3/6]

template<typename preference_t>
device& dx::proxy::device<preference_t>::set(::CFTypeRef properties)
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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set() [4/6]

template<typename preference_t>
template<typename key_t, typename= cf::enable_if_convertible<key_t>>
device& dx::proxy::device<preference_t>::set(key_t key, ::CFTypeRef value)
inline
Here is the call graph for this function:

◆ set() [5/6]

template<typename preference_t>
template<typename key_t, typename value_t, typename= cf::enable_if_convertible<key_t>, typename= cf::enable_if_convertible<value_t>>
device& dx::proxy::device<preference_t>::set(key_t key, value_t value)
inline
Here is the call graph for this function:

◆ set() [6/6]

registry& dx::registry::set(::DWORD type, const void* value, size_t size)
inlineinherited

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size() [1/2]

size_t dx::registry::size() const
inlinenoexceptinherited

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size() [2/2]

template<typename self_t>
size_t dx::registry::size(const self_t& self)
inlinestaticnoexceptinherited
Here is the call graph for this function:

◆ sleep() [1/2]

virtual void dx::device<std::string, preference_t>::sleep()
inlinevirtualinherited

notify system will sleep stub

◆ sleep() [2/2]

virtual void dx::device<::io_service_t, preference_t>::sleep()
inlinevirtualinherited

notify system will sleep stub

◆ string()

template<typename preference_t>
std::string dx::proxy::device<preference_t>::string(uint8_t) const
inline

◆ try_conclude() [1/2]

bool dx::object::try_conclude()
inlinenoexceptinherited

atomically conclude()s if currently launched; returns whether this call did it

◆ try_conclude() [2/2]

bool dx::object::try_conclude()
inlinenoexceptinherited

atomically conclude()s if currently launched; returns whether this call did it

◆ try_launch() [1/2]

bool dx::object::try_launch()
inlineinherited

atomically launch()es if not already launched; returns whether this call did it. A launch() that throws is concluded before the exception leaves: the object never claims a launch it did not finish

◆ try_launch() [2/2]

bool dx::object::try_launch()
inlineinherited

atomically launch()es if not already launched; returns whether this call did it. A launch() that throws is concluded before the exception leaves: the object never claims a launch it did not finish

◆ type()

type dx::registry::type() const
inlinenoexceptinherited

◆ unmap() [1/2]

template<typename preference_t>
template<typename rx_t>
const device& dx::proxy::device<preference_t>::unmap(uint32_t type, rx_t* rx) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unmap() [2/2]

template<typename preference_t>
template<typename rx_t>
const device& dx::proxy::device<preference_t>::unmap(uint32_t, rx_t*) const
inline
Here is the call graph for this function:

◆ wake() [1/2]

virtual void dx::device<std::string, preference_t>::wake()
inlinevirtualinherited

◆ wake() [2/2]

virtual void dx::device<::io_service_t, preference_t>::wake()
inlinevirtualinherited

notify system wake completed stub

Member Data Documentation

◆ broadcast

template<typename preference_t>
dx::listen<std::function<void()>> dx::proxy::device<preference_t>::broadcast

the driver's values mirrored here that listen: each reads itself back where it stands initialized

◆ connected

template<typename preference_t>
bool dx::proxy::device<preference_t>::connected= false
protected

◆ driver [1/2]

dx::driver<decltype(id), preference_t>& dx::device<std::string, preference_t>::driver
inherited

◆ driver [2/2]

dx::driver<decltype(id), preference_t>& dx::device<::io_service_t, preference_t>::driver
inherited

◆ handle

template<::HANDLE invalid_t= INVALID_HANDLE_VALUE>
::HANDLE dx::resource<invalid_t>::handle{invalid_t}
protectedinherited

◆ id [1/2]

const std::string dx::device<std::string, preference_t>::id
inherited

◆ id [2/2]

const ::io_service_t dx::device<::io_service_t, preference_t>::id
inherited

◆ kernel

struct { ... } dx::registry::device<preference_t>::kernel

◆ key

std::string dx::registry::key
inherited

◆ launched [1/2]

std::atomic<bool> dx::object::launched
inherited

◆ launched [2/2]

std::atomic<bool> dx::object::launched
inherited

◆ listen

std::deque<std::function<void()>> dx::registry::listen
inherited

◆ listener

template<typename preference_t>
event dx::proxy::device<preference_t>::listener
Initial value:
{[this]{
broadcast>> [](const auto& listeners){
for(const auto& listener: listeners)
listener.second();
};
}}
internal helper to map single listener into listerners map
Definition dx_common.h:167
dx::listen< std::function< void()> > broadcast
the driver's values mirrored here that listen: each reads itself back where it stands initialized
Definition macOS/proxy/dx_proxy_device.h:161
event listener
this client's listener on the driver's values: every change it signals reads them back
Definition macOS/proxy/dx_proxy_device.h:163

this client's listener on the driver's values: every change it signals reads them back

◆ port

template<typename preference_t>
io::port dx::proxy::device<preference_t>::port
protected

◆ preference [1/2]

preference_t dx::device<std::string, preference_t>::preference
inherited

◆ preference [2/2]

preference_t dx::device<::io_service_t, preference_t>::preference
inherited

◆ process

template<::HANDLE invalid_t= INVALID_HANDLE_VALUE>
::HANDLE dx::resource<invalid_t>::process{::GetCurrentProcess()}
protectedinherited

◆ puid [1/2]

std::string dx::device<std::string, preference_t>::puid
inherited

persistent UID - system unique - could change with location

◆ puid [2/2]

std::string dx::device<::io_service_t, preference_t>::puid
inherited

persistent UID - system unique - could change with location

◆ puuid [1/2]

std::string dx::device<std::string, preference_t>::puuid
inherited

persistent universal UID - universally unique ID (i.e. serial number)

◆ puuid [2/2]

std::string dx::device<::io_service_t, preference_t>::puuid
inherited

persistent universal UID - universally unique ID (i.e. serial number)

◆ schedule_erase

bool dx::registry::schedule_erase{}
inherited

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