co_usb
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
co_usb::detail::handler_service Struct Reference

Service for handling libusb events. More...

#include <service.hpp>

Inheritance diagram for co_usb::detail::handler_service:
Inheritance graph
[legend]
Collaboration diagram for co_usb::detail::handler_service:
Collaboration graph
[legend]

Public Types

using handler_fn_t = void(*)(libusb_context *, std::stop_token)
 

Public Member Functions

 handler_service (boost::capy::execution_context &ctx)
 
template<std::invocable< libusb_context *, std::stop_token > HandlerFn>
void start_thread (std::shared_ptr< libusb_context > ctx, HandlerFn &&handler_fn)
 Creates a default handler thread.
 
std::stop_source stop_source ()
 
 ~handler_service () override
 
void shutdown () override
 

Detailed Description

Service for handling libusb events.

creates a primitive libusb event handler thread. Said handler is guaranteed to NOT support multithreaded handling and must be assumed to be as primitive as humanly possible;

Member Typedef Documentation

◆ handler_fn_t

Constructor & Destructor Documentation

◆ handler_service()

co_usb::detail::handler_service::handler_service ( boost::capy::execution_context &  ctx)

◆ ~handler_service()

co_usb::detail::handler_service::~handler_service ( )
override

Member Function Documentation

◆ shutdown()

void co_usb::detail::handler_service::shutdown ( )
override

◆ start_thread()

template<std::invocable< libusb_context *, std::stop_token > HandlerFn>
void co_usb::detail::handler_service::start_thread ( std::shared_ptr< libusb_context ctx,
HandlerFn &&  handler_fn 
)
inline

Creates a default handler thread.

Cannot be put into ctor because this must be optional and services cannot take additional ctor params.

◆ stop_source()

std::stop_source co_usb::detail::handler_service::stop_source ( )

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