co_usb
Loading...
Searching...
No Matches
device_ref.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <libusb-1.0/libusb.h>
4
5namespace co_usb
6{
7
17{
21 device_ref() noexcept;
22
26 explicit device_ref(libusb_device *dev) noexcept;
27
28 ~device_ref() noexcept;
29
30 device_ref(const device_ref &) noexcept;
31 device_ref &operator=(const device_ref &) noexcept;
32
36 libusb_device *get() const noexcept;
37
38 private:
39 libusb_device *m_dev;
40};
41
42} // namespace co_usb
Definition context.hpp:14
use_service
Definition context.hpp:17
Wrapper for nullable libusb_device that increments ref count on ctor and decrements on dtor.
Definition device_ref.hpp:17
device_ref() noexcept
constructs a null ref
Definition device_ref.cpp:4
libusb_device * get() const noexcept
Definition device_ref.cpp:19
device_ref & operator=(const device_ref &) noexcept
Definition device_ref.cpp:31
~device_ref() noexcept
Definition device_ref.cpp:13