|
co_usb
|
Complete I/O adapter for transfer sequences. More...
#include <complete_io.hpp>


Public Member Functions | |
| complete_io_base (boost::capy::executor_ref exec, TSeq const &tfer_seq, size_t single_transfer_limit, std::pmr::memory_resource *memres=std::pmr::get_default_resource()) | |
| template<detail::AnyBufferSequence BuffersTy> | |
| auto | complete_submit (BuffersTy const &buffers) -> boost::capy::io_task< size_t > |
Public Member Functions inherited from co_usb::transfer::detail::partial_io_base< TSeq > | |
| partial_io_base (boost::capy::executor_ref exec, TSeq const &tfer_seq) | |
| template<detail::AnyBufferSequence BuffersTy> | |
| auto | submit (BuffersTy const &buffers) -> boost::capy::io_task< size_t > |
| Submit a transfer sequence for a buffer sequence. | |
Additional Inherited Members | |
Protected Attributes inherited from co_usb::transfer::detail::partial_io_base< TSeq > | |
| ev::event_handler_ref | m_ev_ref |
| sequence_view< TSeq > | m_view |
Complete I/O adapter for transfer sequences.
Adoptor which allows to submit N transfers from a sequence for sequence of M buffers until each buffer is fully processed. This operation is transfer-affine, meaning that a single transfer will not jump to another buffer until it has finished filling the current one it holds.
Transfer sequence is expected to outlive an instance of this type which uses it. Deallocating, modifying and replacing transfers while an asynchronous operation is pending is undefined behaviour unless it is a cancel_transfer call in which case the operation is well-defined and will cause this particular transfer to be cancelled and cause an error with transfer_status cancelled value.
The submissions are done in a streaming manner, hence the name, where the N transfers from a sequence will be reused for M buffers, in an order in which the transfers complete. This allows to saturate the USB controller ring with large enough set of buffers. In practice, however, the amount of transfers provided has diminishing returns due to internal libusb mutex and ring oversaturation, and after a certain points using more transfers will be slower than using fewer.
To prevent event handler from prematurely shutting down on stop request an event_handler_ref is held for the entire lifetime of an object of this type.
|
inlineexplicit |
|
inline |