dxd - dynax driver framework 3.0.1d223
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::proxy::driver< device_t > Class Template Referenceabstract

#include <dx_proxy_driver.h>

Inheritance diagram for dx::proxy::driver< device_t >:
Collaboration diagram for dx::proxy::driver< device_t >:

Classes

struct  notification
 the device notifications this driver's window is subscribed to: one per interface class it matches, and one per open handle whose removal it must hear about More...
struct  property
 this bus's name in the device tree and the preference store More...
class  setup
 the device information set of one interface class: what enumerates the devices present and names their paths More...

Public Types

typedef std::conditional_t< held, typename view::template iterator< typename holders::const_iterator >, typename holders::const_iterator > const_iterator
typedef std::conditional_t< held, typename view::template iterator< typename holders::const_iterator >, typename holders::const_iterator > const_iterator
typedef std::conditional_t< held, typename view::template iterator< typename holders::iterator >, typename holders::iterator > iterator
typedef std::conditional_t< held, typename view::template iterator< typename holders::iterator >, typename holders::iterator > iterator
typedef driver map
typedef driver map
typedef decltype(matching_ids) match
typedef decltype(matching_ids) match
typedef driver_settings< dx::promoted< dx::log >::preference< decltype(device<>::preference) > > settings
typedef driver_settings< dx::promoted< dx::log >::preference< decltype(device<>::preference) > > settings
typedef std::conditional_t< held, typename view::value_type, typename holders::value_type > value_type
typedef std::conditional_t< held, typename view::value_type, typename holders::value_type > value_type

Public Member Functions

iterator begin () noexcept
iterator begin () noexcept
virtual bool boot ()
void conclude () noexcept override
 the device notifications go ahead of their window
bool contains (const std::string &id) noexcept
template<typename desc_t>
void create (const std::string &, const desc_t &)
driver & create (const std::string &id, const typename super::device_t::desc_t &desc) override
 device arrival/removal follows through PnP's own interface notifications
void destroy (const std::string &)
driver & destroy (const std::string &id) override
 driver (const char *product_id, dx::log log={})
 driver (const match &matching_idsmatching_ids, const char *product_id, const decltype(super::preference)&preferencepreference, dx::log log={})
 the virtual driver interface class constructor
 driver (const match &matching_idsmatching_ids, const char *product_id, const decltype(super::preference)&preferencepreference, dx::log log={})
 the driver interface class constructor
 driver (const match &matching_idsmatching_ids, const char *product_id, dx::log log={})
 driver (const match &matching_idsmatching_ids, const char *product_id, dx::log log={})
iterator end () noexcept
iterator end () noexcept
void exception (const class exception &exception, bool filtered=false) const noexcept override
 notification exception handler
void exception (const class exception &exception, bool filtered=false) const noexcept override
 notification exception handler
virtual void exception (const exception &exception, bool filtered=false) const noexcept=0
 notification exception handler
iterator find (const device_id_t &device_id)
iterator find (const device_id_t &device_id)
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.
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.
virtual operator bool () const noexcept
virtual driver & operator<< (std::ifstream &)
 restores device settings
virtual driver & operator>> (std::ostream &ostream) const
 saves device tree
virtual bool shutdown ()
 client driver::shutdown/boot(): override to shutdown/boot host driver
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
std::shared_ptr< typename super::device_t > wait (const std::string &id) noexcept

Public Attributes

cf::string connection_id = ::IOObjectCopyBundleIdentifierForClass(cf::string{this->product_id}.retain())
T elements
 STL member.
T elements
 STL member.
K keys
 STL member.
K keys
 STL member.
std::atomic< bool > launched
std::atomic< bool > launched
dx::log log
 cached local log level, mirrors settings::log
dx::log log
 cached local log level, mirrors settings::log
decltype(device<>::preference) preference
decltype(device<>::preference) preference
const char * product_id
const char * product_id
io::registry registry {::IOServiceGetMatchingService(::kIOMainPortDefault, cf::dictionary<>{}.set(CFSTR("IOUserServerName"), *this).retain())}
std::deque< setup > setup
promoted< os_result > status
 the driver's condition, promoted so a host follows it without polling
promoted< os_result > status
 the driver's condition, promoted so a host follows it without polling
uint32_t version
uint32_t version

Static Public Attributes

static constexpr auto connection_id {class_name}

Protected Types

typedef decltype(device_t::id) device_id_t
typedef decltype(device_t::id) device_id_t
typedef device<> device_t
typedef device<> device_t
typedef std::map< device_id_t, std::shared_ptr< device<> > > holders
typedef std::map< device_id_t, std::shared_ptr< device<> > > holders
typedef std::vector< cf::dictionary<> > matching_ids

Protected Member Functions

virtual void add (const decltype(device<>::id) &)=0
 adds a new device to the device list
virtual void add (const decltype(device<>::id) &)=0
 adds a new device to the device list
void add (const device_id_t &device_id) override
 adds a new device to the device list
void add (const device_id_t &device_id) override
 adds a new device to the device list
virtual void arrived ()
 notify device arrivals completed stub
virtual void arrived ()
 notify device arrivals completed stub
void arrived (super::device_t &device) override
virtual void clear () noexcept
 replaces std::map::clear to call virtual notification methods
virtual void remove (const decltype(device<>::id) &)=0
 finds and removes a device from the device list
virtual void remove (const decltype(device<>::id) &)=0
 finds and removes a device from the device list
void remove (const device_id_t &device_id) override
 finds and removes a device from the device list
void remove (const device_id_t &device_id) override
 finds and removes a device from the device list
virtual void removed () noexcept
 notify device removals completed stub
virtual void removed () noexcept
 notify device removals completed stub
void sleep () override
 < notify system will sleep
void sleep () override
 < notify system will sleep
void wake () override
void wake () override

Protected Attributes

std::set< dx::guid > matching_ids
struct dx::proxy::driver::notification notification

Member Typedef Documentation

◆ const_iterator [1/2]

typedef std::conditional_t<held, typename view::template iterator<typename holders::const_iterator>, typename holders::const_iterator> dx::map::driver< device<>, device<> >::const_iterator
inherited

◆ const_iterator [2/2]

typedef std::conditional_t<held, typename view::template iterator<typename holders::const_iterator>, typename holders::const_iterator> dx::map::driver< device<>, device<> >::const_iterator
inherited

◆ device_id_t [1/2]

typedef decltype(device_t::id) dx::map::driver< device<>, device<> >::device_id_t
protectedinherited

◆ device_id_t [2/2]

typedef decltype(device_t::id) dx::map::driver< device<>, device<> >::device_id_t
protectedinherited

◆ device_t [1/2]

typedef device<> dx::map::driver< device<>, device<> >::device_t
protectedinherited

◆ device_t [2/2]

typedef device<> dx::map::driver< device<>, device<> >::device_t
protectedinherited

◆ holders [1/2]

typedef std::map<device_id_t, std::shared_ptr<device<>> > dx::map::driver< device<>, device<> >::holders
protectedinherited

◆ holders [2/2]

typedef std::map<device_id_t, std::shared_ptr<device<>> > dx::map::driver< device<>, device<> >::holders
protectedinherited

◆ iterator [1/2]

typedef std::conditional_t<held, typename view::template iterator<typename holders::iterator>, typename holders::iterator> dx::map::driver< device<>, device<> >::iterator
inherited

◆ iterator [2/2]

typedef std::conditional_t<held, typename view::template iterator<typename holders::iterator>, typename holders::iterator> dx::map::driver< device<>, device<> >::iterator
inherited

◆ map [1/2]

typedef driver dx::map::driver< device<>, device<> >::map
inherited

◆ map [2/2]

typedef driver dx::map::driver< device<>, device<> >::map
inherited

◆ match [1/2]

template<typename device_t = device<>>
typedef decltype(matching_ids) dx::proxy::driver< device_t >::match

◆ match [2/2]

template<typename device_t = device<>>
typedef decltype(matching_ids) dx::proxy::driver< device_t >::match
Todo
proxy::driver::connection_id: reflect driver presence

◆ matching_ids

template<typename device_t = device<>>
std::vector<cf::dictionary<> > dx::proxy::driver< device_t >::matching_ids
protected

◆ settings [1/2]

typedef driver_settings<dx::promoted<dx::log>::preference<decltype(device<>::preference)> > dx::driver< decltype(device<>::id), decltype(device<>::preference) >::settings
inherited

the driver's own settings: the log a promoted::preference on the store's dx::log::id node, resolved like a stream desc (dx::log's DX_TREE_SERIALIZE), the constructor's log its default - stored as no entry, reloaded on the store's change

◆ settings [2/2]

typedef driver_settings<dx::promoted<dx::log>::preference<decltype(device<>::preference)> > dx::driver< decltype(device<>::id), decltype(device<>::preference) >::settings
inherited

the driver's own settings: the log a promoted::preference on the store's dx::log::id node, resolved like a stream desc (dx::log's DX_TREE_SERIALIZE), the constructor's log its default - stored as no entry, reloaded on the store's change

◆ value_type [1/2]

typedef std::conditional_t<held, typename view::value_type, typename holders::value_type> dx::map::driver< device<>, device<> >::value_type
inherited

◆ value_type [2/2]

typedef std::conditional_t<held, typename view::value_type, typename holders::value_type> dx::map::driver< device<>, device<> >::value_type
inherited

Constructor & Destructor Documentation

◆ driver() [1/5]

template<typename device_t = device<>>
dx::proxy::driver< device_t >::driver ( const match & matching_ids,
const char * product_id,
const decltype(super::preference)& preference,
dx::log log = {} )
inline

the virtual driver interface class constructor

checks if kext is installed at all

Parameters
matching_idsthe matching device IDs identifying the OS driver interface
product_iddriver ID
preferencepreference
loglog settings

◆ driver() [2/5]

template<typename device_t = device<>>
dx::proxy::driver< device_t >::driver ( const match & matching_ids,
const char * product_id,
dx::log log = {} )
inline

◆ driver() [3/5]

template<typename device_t = device<>>
dx::proxy::driver< device_t >::driver ( const char * product_id,
dx::log log = {} )
inline

◆ driver() [4/5]

template<typename device_t = device<>>
dx::proxy::driver< device_t >::driver ( const match & matching_ids,
const char * product_id,
const decltype(super::preference)& preference,
dx::log log = {} )
inline

the driver interface class constructor

Parameters
matching_idsthe matching device IDs identifying the OS driver interface
product_iddriver ID
preferencepreference
loglog settings

◆ driver() [5/5]

template<typename device_t = device<>>
dx::proxy::driver< device_t >::driver ( const match & matching_ids,
const char * product_id,
dx::log log = {} )
inline

Member Function Documentation

◆ add() [1/4]

virtual void dx::driver< decltype(device<>::id), decltype(device<>::preference) >::add ( const decltype(device<>::id) & )
protectedpure virtualinherited

adds a new device to the device list

Exceptions
dx::exception

◆ add() [2/4]

virtual void dx::driver< decltype(device<>::id), decltype(device<>::preference) >::add ( const decltype(device<>::id) & )
protectedpure virtualinherited

adds a new device to the device list

Exceptions
dx::exception

◆ add() [3/4]

void dx::map::driver< device<>, device<> >::add ( const device_id_t & device_id)
inlineoverrideprotectedinherited

adds a new device to the device list

Exceptions
dx::exception
Here is the caller graph for this function:

◆ add() [4/4]

void dx::map::driver< device<>, device<> >::add ( const device_id_t & device_id)
inlineoverrideprotectedinherited

adds a new device to the device list

Exceptions
dx::exception
Here is the caller graph for this function:

◆ arrived() [1/3]

( )
protectedvirtualinherited

notify device arrivals completed stub

Reimplemented from dx::driver< decltype(device<>::id), decltype(device<>::preference)>.

Here is the caller graph for this function:

◆ arrived() [2/3]

( )
protectedvirtualinherited

notify device arrivals completed stub

Reimplemented from dx::driver< decltype(device<>::id), decltype(device<>::preference)>.

Here is the caller graph for this function:

◆ arrived() [3/3]

void dx::stream::driver< dx::map::driver< device<> > >::arrived ( super::device_t & device)
inlineoverrideprotectedinherited

◆ begin() [1/2]

iterator dx::map::driver< device<>, device<> >::begin ( )
inlinenoexceptinherited

◆ begin() [2/2]

iterator dx::map::driver< device<>, device<> >::begin ( )
inlinenoexceptinherited

◆ boot()

virtual bool dx::driver< decltype(device<>::id), decltype(device<>::preference) >::boot ( )
inlinevirtualinherited

◆ clear()

virtual void dx::map::driver< device<>, device<> >::clear ( )
inlineprotectedvirtualnoexceptinherited

replaces std::map::clear to call virtual notification methods

◆ conclude()

template<typename device_t = device<>>
void dx::proxy::driver< device_t >::conclude ( )
inlineoverridevirtualnoexcept

the device notifications go ahead of their window

Reimplemented from dx::map::driver< device<> >.

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

◆ contains()

bool dx::stream::driver< dx::map::driver< device<> > >::contains ( const std::string & id)
inlinenoexceptinherited

◆ create() [1/2]

template<typename device_t = device<>>
template<typename desc_t>
void dx::proxy::driver< device_t >::create ( const std::string & ,
const desc_t &  )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create() [2/2]

template<typename device_t = device<>>
driver & dx::proxy::driver< device_t >::create ( const std::string & id,
const typename super::device_t::desc_t & desc )
inlineoverridevirtual

device arrival/removal follows through PnP's own interface notifications

Todo
proxy::driver::operator bool() check if driver is installed

Reimplemented from dx::stream::driver< dx::map::driver< device<> > >.

◆ destroy() [1/2]

template<typename device_t = device<>>
void dx::proxy::driver< device_t >::destroy ( const std::string & )
inlinevirtual

Reimplemented from dx::stream::driver< dx::map::driver< device<> > >.

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

◆ destroy() [2/2]

template<typename device_t = device<>>
driver & dx::proxy::driver< device_t >::destroy ( const std::string & id)
inlineoverridevirtual

Reimplemented from dx::stream::driver< dx::map::driver< device<> > >.

Here is the call graph for this function:

◆ end() [1/2]

iterator dx::map::driver< device<>, device<> >::end ( )
inlinenoexceptinherited

◆ end() [2/2]

iterator dx::map::driver< device<>, device<> >::end ( )
inlinenoexceptinherited

◆ exception() [1/3]

void dx::driver< decltype(device<>::id), decltype(device<>::preference) >::exception ( const class exception & exception,
bool filtered = false ) const
inlineoverridenoexceptinherited

notification exception handler

◆ exception() [2/3]

void dx::driver< decltype(device<>::id), decltype(device<>::preference) >::exception ( const class exception & exception,
bool filtered = false ) const
inlineoverridenoexceptinherited

notification exception handler

◆ exception() [3/3]

virtual void dx::object::exception ( const exception & exception,
bool filtered = false ) const
pure virtualnoexceptinherited

notification exception handler

◆ find() [1/2]

iterator dx::map::driver< device<>, device<> >::find ( const device_id_t & device_id)
inlineinherited

◆ find() [2/2]

iterator dx::map::driver< device<>, device<> >::find ( const device_id_t & device_id)
inlineinherited

◆ launch() [1/2]

template<typename device_t = device<>>
virtual void dx::proxy::driver< device_t >::launch ( )
inlinevirtual

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::map::driver< device<> >.

Here is the call graph for this function:

◆ launch() [2/2]

template<typename device_t = device<>>
void dx::proxy::driver< device_t >::launch ( )
inlineoverridevirtual

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::map::driver< device<> >.

Here is the call graph for this function:

◆ operator bool()

template<typename device_t = device<>>
virtual dx::proxy::driver< device_t >::operator bool ( ) const
inlinevirtualnoexcept

◆ operator<<()

virtual driver & dx::map::driver< device<>, device<> >::operator<< ( std::ifstream & )
inlinevirtualinherited

restores device settings

◆ operator>>()

virtual driver & dx::map::driver< device<>, device<> >::operator>> ( std::ostream & ostream) const
inlinevirtualinherited

saves device tree

◆ remove() [1/4]

virtual void dx::driver< decltype(device<>::id), decltype(device<>::preference) >::remove ( const decltype(device<>::id) & )
protectedpure virtualinherited

finds and removes a device from the device list

◆ remove() [2/4]

virtual void dx::driver< decltype(device<>::id), decltype(device<>::preference) >::remove ( const decltype(device<>::id) & )
protectedpure virtualinherited

finds and removes a device from the device list

◆ remove() [3/4]

void dx::map::driver< device<>, device<> >::remove ( const device_id_t & device_id)
inlineoverrideprotectedinherited

finds and removes a device from the device list

Exceptions
dx::exception

◆ remove() [4/4]

void dx::map::driver< device<>, device<> >::remove ( const device_id_t & device_id)
inlineoverrideprotectedinherited

finds and removes a device from the device list

Exceptions
dx::exception

◆ removed() [1/2]

( )
protectedvirtualinherited

notify device removals completed stub

Reimplemented from dx::driver< decltype(device<>::id), decltype(device<>::preference)>.

◆ removed() [2/2]

( )
protectedvirtualinherited

notify device removals completed stub

Reimplemented from dx::driver< decltype(device<>::id), decltype(device<>::preference)>.

◆ shutdown()

virtual bool dx::driver< decltype(device<>::id), decltype(device<>::preference) >::shutdown ( )
inlinevirtualinherited

client driver::shutdown/boot(): override to shutdown/boot host driver

◆ sleep() [1/2]

void dx::map::driver< device<>, device<> >::sleep ( )
inlineoverrideprotectedinherited

< notify system will sleep

notify system wake completed stub

◆ sleep() [2/2]

void dx::map::driver< device<>, device<> >::sleep ( )
inlineoverrideprotectedinherited

< notify system will sleep

notify system wake completed stub

◆ 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

◆ wait()

std::shared_ptr< typename super::device_t > dx::stream::driver< dx::map::driver< device<> > >::wait ( const std::string & id)
inlinenoexceptinherited

◆ wake() [1/2]

void dx::map::driver< device<>, device<> >::wake ( )
inlineoverrideprotectedinherited

◆ wake() [2/2]

void dx::map::driver< device<>, device<> >::wake ( )
inlineoverrideprotectedinherited

Member Data Documentation

◆ connection_id [1/2]

template<typename device_t = device<>>
cf::string dx::proxy::driver< device_t >::connection_id = ::IOObjectCopyBundleIdentifierForClass(cf::string{this->product_id}.retain())

◆ connection_id [2/2]

template<typename device_t = device<>>
auto dx::proxy::driver< device_t >::connection_id {class_name}
staticconstexpr

◆ elements [1/2]

T std::map< K, T >::elements
inherited

STL member.

◆ elements [2/2]

T std::map< K, T >::elements
inherited

STL member.

◆ keys [1/2]

K std::map< K, T >::keys
inherited

STL member.

◆ keys [2/2]

K std::map< K, T >::keys
inherited

STL member.

◆ launched [1/2]

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

◆ launched [2/2]

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

◆ log [1/2]

dx::log dx::driver< decltype(device<>::id), decltype(device<>::preference) >::log
inherited

cached local log level, mirrors settings::log

◆ log [2/2]

dx::log dx::driver< decltype(device<>::id), decltype(device<>::preference) >::log
inherited

cached local log level, mirrors settings::log

◆ matching_ids

template<typename device_t = device<>>
std::set<dx::guid> dx::proxy::driver< device_t >::matching_ids
protected

◆ notification

template<typename device_t = device<>>
struct dx::proxy::driver::notification dx::proxy::driver< device_t >::notification
protected

◆ preference [1/2]

decltype(device<>::preference) dx::driver< decltype(device<>::id), decltype(device<>::preference) >::preference
inherited

◆ preference [2/2]

decltype(device<>::preference) dx::driver< decltype(device<>::id), decltype(device<>::preference) >::preference
inherited

◆ product_id [1/2]

const char* dx::driver< decltype(device<>::id), decltype(device<>::preference) >::product_id
inherited

◆ product_id [2/2]

const char* dx::driver< decltype(device<>::id), decltype(device<>::preference) >::product_id
inherited

◆ registry

template<typename device_t = device<>>
io::registry dx::proxy::driver< device_t >::registry {::IOServiceGetMatchingService(::kIOMainPortDefault, cf::dictionary<>{}.set(CFSTR("IOUserServerName"), *this).retain())}

◆ setup

template<typename device_t = device<>>
std::deque<setup> dx::proxy::driver< device_t >::setup

◆ status [1/2]

promoted<os_result> dx::driver< decltype(device<>::id), decltype(device<>::preference) >::status
inherited

the driver's condition, promoted so a host follows it without polling

◆ status [2/2]

promoted<os_result> dx::driver< decltype(device<>::id), decltype(device<>::preference) >::status
inherited

the driver's condition, promoted so a host follows it without polling

◆ version [1/2]

uint32_t dx::driver< decltype(device<>::id), decltype(device<>::preference) >::version
inherited

◆ version [2/2]

uint32_t dx::driver< decltype(device<>::id), decltype(device<>::preference) >::version
inherited

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

(c) copyright 2009 dynamic acoustics e.U. generated on

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.