co_usb
Loading...
Searching...
No Matches
co_usb::interface Struct Reference

RAII wrapper for an interface. More...

#include <interface.hpp>

Public Member Functions

 ~interface () noexcept(false)
 Releases the interface.
 
 interface (interface const &)=delete
 
interfaceoperator= (interface const &)=delete
 
 interface (interface &&other) noexcept
 
interfaceoperator= (interface &&other)
 
auto release (std::error_code &ec) noexcept -> void
 Releases the interface.
 
auto devh () const noexcept -> libusb_device_handle *
 
auto interface_num () const noexcept -> int
 
 interface (detail::DeviceHandleSource auto const &devh_src, int interface_num)
 

Detailed Description

RAII wrapper for an interface.

This type assumes the interface is already claimed at the point of construction. The destructor will attempt to release the interface and may throw if the release operation fails.

Note
Satisfies detail::DeviceHandleSource.
See also
co_usb::claim_interface

Constructor & Destructor Documentation

◆ ~interface()

co_usb::interface::~interface ( )
inline

Releases the interface.

Exceptions
std::system_errorif release fails.

Use release to avoid throwing.

◆ interface() [1/3]

co_usb::interface::interface ( interface const &  )
delete

◆ interface() [2/3]

co_usb::interface::interface ( interface &&  other)
inlinenoexcept

◆ interface() [3/3]

co_usb::interface::interface ( detail::DeviceHandleSource auto const &  devh_src,
int  interface_num 
)
inlineexplicit

Member Function Documentation

◆ devh()

auto co_usb::interface::devh ( ) const -> libusb_device_handle *
inlinenoexcept

◆ interface_num()

auto co_usb::interface::interface_num ( ) const -> int
inlinenoexcept

◆ operator=() [1/2]

interface & co_usb::interface::operator= ( interface &&  other)
inline

◆ operator=() [2/2]

interface & co_usb::interface::operator= ( interface const &  )
delete

◆ release()

auto co_usb::interface::release ( std::error_code &  ec) -> void
inlinenoexcept

Releases the interface.

Sets the error code if the release operation fails.


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