co_usb
Loading...
Searching...
No Matches
co_usb::transfer::detail::direction_complete_io_base< TSeq, EpDirection > Struct Template Reference

Interface complying with Boost.Http's ReadSource and WriteSink concepts. More...

#include <complete_io.hpp>

Inheritance diagram for co_usb::transfer::detail::direction_complete_io_base< TSeq, EpDirection >:

Public Member Functions

 direction_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<boost::capy::MutableBufferSequence BuffersTy>
requires (EpDirection == endpoint_direction::in)
auto read_some (BuffersTy const &buffers) -> boost::capy::io_task< size_t >
 Performs partial read to a buffer sequence.
 
template<boost::capy::MutableBufferSequence BuffersTy>
requires (EpDirection == endpoint_direction::in)
auto read (BuffersTy const &buffers) -> boost::capy::io_task< size_t >
 Performs complete read to a buffer sequence.
 
template<boost::capy::ConstBufferSequence BuffersTy>
requires (EpDirection == endpoint_direction::out)
auto write_some (BuffersTy const &buffers) -> boost::capy::io_task< size_t >
 
template<boost::capy::ConstBufferSequence BuffersTy>
requires (EpDirection == endpoint_direction::out)
auto write (BuffersTy const &buffers) -> boost::capy::io_task< size_t >
 Performs complete write from a buffer sequence.
 
template<boost::capy::ConstBufferSequence BuffersTy>
requires (EpDirection == endpoint_direction::out)
auto write_eof (BuffersTy const &buffers) -> boost::capy::io_task< size_t >
 Performs complete write from a buffer sequence.
 
template<boost::capy::ConstBufferSequence BuffersTy>
requires (EpDirection == endpoint_direction::out)
auto write_eof () -> boost::capy::io_task<>
 Indicates EOF and closes the sink.
 

Detailed Description

template<TransferSequence TSeq, endpoint_direction EpDirection>
struct co_usb::transfer::detail::direction_complete_io_base< TSeq, EpDirection >

Interface complying with Boost.Http's ReadSource and WriteSink concepts.

ReadSource and WriteSink concepts were once defined in Capy. Since then they had been moved to Boost.Http because they were only used in it and the libraries based on it. This interface will be kept regardless to increase interoperability.

Note
EOF handling is ignored because USB does not always operate with EOF in mind.

Constructor & Destructor Documentation

◆ direction_complete_io_base()

template<TransferSequence TSeq, endpoint_direction EpDirection>
co_usb::transfer::detail::direction_complete_io_base< TSeq, EpDirection >::direction_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() 
)
inlineexplicit

Member Function Documentation

◆ read()

template<TransferSequence TSeq, endpoint_direction EpDirection>
template<boost::capy::MutableBufferSequence BuffersTy>
requires (EpDirection == endpoint_direction::in)
auto co_usb::transfer::detail::direction_complete_io_base< TSeq, EpDirection >::read ( BuffersTy const &  buffers) -> boost::capy::io_task<size_t>
inline

Performs complete read to a buffer sequence.

Will attempt to completely fill the given buffer sequence. Reading less is always coupled with an error.

◆ read_some()

template<TransferSequence TSeq, endpoint_direction EpDirection>
template<boost::capy::MutableBufferSequence BuffersTy>
requires (EpDirection == endpoint_direction::in)
auto co_usb::transfer::detail::direction_complete_io_base< TSeq, EpDirection >::read_some ( BuffersTy const &  buffers) -> boost::capy::io_task<size_t>
inline

Performs partial read to a buffer sequence.

May read less than the buffer size.

◆ write()

template<TransferSequence TSeq, endpoint_direction EpDirection>
template<boost::capy::ConstBufferSequence BuffersTy>
requires (EpDirection == endpoint_direction::out)
auto co_usb::transfer::detail::direction_complete_io_base< TSeq, EpDirection >::write ( BuffersTy const &  buffers) -> boost::capy::io_task<size_t>
inline

Performs complete write from a buffer sequence.

Will attempt to write all data from the given buffer sequence. Writing less is always coupled with an error.

◆ write_eof() [1/2]

template<TransferSequence TSeq, endpoint_direction EpDirection>
template<boost::capy::ConstBufferSequence BuffersTy>
requires (EpDirection == endpoint_direction::out)
auto co_usb::transfer::detail::direction_complete_io_base< TSeq, EpDirection >::write_eof ( ) -> boost::capy::io_task<>
inline

Indicates EOF and closes the sink.

Note
EOF is a no-op.

◆ write_eof() [2/2]

template<TransferSequence TSeq, endpoint_direction EpDirection>
template<boost::capy::ConstBufferSequence BuffersTy>
requires (EpDirection == endpoint_direction::out)
auto co_usb::transfer::detail::direction_complete_io_base< TSeq, EpDirection >::write_eof ( BuffersTy const &  buffers) -> boost::capy::io_task<size_t>
inline

Performs complete write from a buffer sequence.

Will attempt to write all data from the given buffer sequence. Writing less is always coupled with an error.

Note
EOF is a no-op.

◆ write_some()

template<TransferSequence TSeq, endpoint_direction EpDirection>
template<boost::capy::ConstBufferSequence BuffersTy>
requires (EpDirection == endpoint_direction::out)
auto co_usb::transfer::detail::direction_complete_io_base< TSeq, EpDirection >::write_some ( BuffersTy const &  buffers) -> boost::capy::io_task<size_t>
inline

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