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

RAII wrapper around libusb_device_handle*. More...

#include <device_handle.hpp>

Public Member Functions

 device_handle (const device_handle &)=delete
 
 device_handle (device_handle &&)=default
 
device_handleoperator= (const device_handle &)=delete
 
device_handleoperator= (device_handle &&)=default
 
 device_handle (libusb_device_handle *devh)
 
auto get () const noexcept -> libusb_device_handle *
 
auto reset () noexcept
 
auto release () noexcept -> libusb_device_handle *
 
auto close () noexcept
 

Detailed Description

RAII wrapper around libusb_device_handle*.

Note
Satisfies detail::DeviceHandleSource.

Wraps device handle and ensures its lifetime via internal unique pointer. Destructor closes the device.

See also
co_usb::open_device

Constructor & Destructor Documentation

◆ device_handle() [1/3]

co_usb::device_handle::device_handle ( const device_handle )
delete

◆ device_handle() [2/3]

co_usb::device_handle::device_handle ( device_handle &&  )
default

◆ device_handle() [3/3]

co_usb::device_handle::device_handle ( libusb_device_handle *  devh)
inlineexplicit

Member Function Documentation

◆ close()

auto co_usb::device_handle::close ( )
inlinenoexcept

◆ get()

auto co_usb::device_handle::get ( ) const -> libusb_device_handle *
inlinenoexcept

◆ operator=() [1/2]

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

◆ operator=() [2/2]

device_handle & co_usb::device_handle::operator= ( device_handle &&  )
default

◆ release()

auto co_usb::device_handle::release ( ) -> libusb_device_handle *
inlinenoexcept

◆ reset()

auto co_usb::device_handle::reset ( )
inlinenoexcept

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