co_usb
Loading...
Searching...
No Matches
event_handler.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <libusb.h>
9#include <stop_token>
10#include <utility>
11
13{
14
41template <typename Ty>
42concept EventHandler = requires(Ty handler) {
43 {
44 handler.start(std::declval<libusb_context *>(), std::declval<std::stop_token>())
45 } -> std::same_as<bool>;
46 { handler.ref() } noexcept -> std::same_as<void>;
47 { handler.unref() } noexcept -> std::same_as<void>;
48 { handler.stop() } -> std::same_as<void>;
49};
50
51} // namespace co_usb::ev::detail
Concept defining an event handler for libusb.
Definition event_handler.hpp:42
Definition event_handler.hpp:13