co_usb
Loading...
Searching...
No Matches
co_usb::hotplug::device_acceptor Struct Reference

Asio/Corosio-like acceptor for devices via hotplug API. More...

#include <device_acceptor.hpp>

Public Member Functions

 device_acceptor (boost::capy::executor_ref exec, std::pmr::memory_resource *memres=std::pmr::get_default_resource())
 
 ~device_acceptor ()
 
auto shutdown () -> void
 
auto bind (device_triplet triplet, std::error_code &ec) -> void
 
auto bind (device_triplet triplet) -> std::error_code
 
auto listen () -> std::error_code
 
auto close () -> std::error_code
 
auto accept () -> boost::capy::io_task< device_ref >
 
 device_acceptor (const device_acceptor &)=delete
 
device_acceptoroperator= (const device_acceptor &)=delete
 
 device_acceptor (device_acceptor &&)=delete
 
device_acceptoroperator= (device_acceptor &&)=delete
 

Detailed Description

Asio/Corosio-like acceptor for devices via hotplug API.

Provides a common interface for waiting on hotplug arrive events. The acceptor operates with a single hotplug callback with target set to a device triplet values provided via bind method.

Device detachment
If the device was connected and then detached while no accept was active, it will be removed from the internal list and will have to be reconnected to be accepted again.
Symmetric transfer
Any device that arrives after the listen was called will be collected into acceptor's storage, thus allowing to avoid a suspension on accept if the device is already connected.

Constructor & Destructor Documentation

◆ device_acceptor() [1/3]

co_usb::hotplug::device_acceptor::device_acceptor ( boost::capy::executor_ref  exec,
std::pmr::memory_resource *  memres = std::pmr::get_default_resource() 
)
inlineexplicit

◆ ~device_acceptor()

co_usb::hotplug::device_acceptor::~device_acceptor ( )
inline

◆ device_acceptor() [2/3]

co_usb::hotplug::device_acceptor::device_acceptor ( const device_acceptor )
delete

◆ device_acceptor() [3/3]

co_usb::hotplug::device_acceptor::device_acceptor ( device_acceptor &&  )
delete

Member Function Documentation

◆ accept()

auto co_usb::hotplug::device_acceptor::accept ( ) -> boost::capy::io_task<device_ref>
inline

◆ bind() [1/2]

auto co_usb::hotplug::device_acceptor::bind ( device_triplet  triplet) -> std::error_code
inline

◆ bind() [2/2]

auto co_usb::hotplug::device_acceptor::bind ( device_triplet  triplet,
std::error_code &  ec 
) -> void
inline

◆ close()

auto co_usb::hotplug::device_acceptor::close ( ) -> std::error_code
inline

◆ listen()

auto co_usb::hotplug::device_acceptor::listen ( ) -> std::error_code
inline

◆ operator=() [1/2]

device_acceptor & co_usb::hotplug::device_acceptor::operator= ( const device_acceptor )
delete

◆ operator=() [2/2]

device_acceptor & co_usb::hotplug::device_acceptor::operator= ( device_acceptor &&  )
delete

◆ shutdown()

auto co_usb::hotplug::device_acceptor::shutdown ( ) -> void
inline

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