|
livox_mid360_core
C++ driver library for the Livox Mid-360 LiDAR
|
Waits for readability on a set of sockets. More...
#include <livox/mid360/transport.hpp>
Public Member Functions | |
| Poller (Poller &&other) noexcept | |
| Takes over the registrations and the wake descriptor of other. | |
| Poller & | operator= (Poller &&other) noexcept |
| Closes the current wake descriptor and takes over the state of other. | |
| Poller (const Poller &)=delete | |
| Poller & | operator= (const Poller &)=delete |
| std::expected< void, TransportError > | add (const UdpSocket &socket, std::uint64_t tag) |
| Register a socket. tag is returned in ReadyEvent; tags must be unique. | |
| void | remove (std::uint64_t tag) |
| Unregister by tag. Unknown tags are ignored. | |
| std::size_t | size () const noexcept |
| Number of registered sockets. | |
| std::expected< std::span< const ReadyEvent >, TransportError > | wait (std::chrono::milliseconds timeout) |
| Block until at least one socket is readable, wake() is called, or timeout elapses. | |
| void | wake () const noexcept |
| Interrupt a pending or future wait(). Thread-safe. | |
| bool | woken () const noexcept |
| True if the last wait() returned because of wake(). | |
Static Public Member Functions | |
| static std::expected< Poller, TransportError > | create () |
| Create a Poller with its wake descriptor (eventfd on Linux, a pipe elsewhere). | |
Waits for readability on a set of sockets.
One Poller per receive thread. wake() may be called from any thread to interrupt wait().
|
staticnodiscard |
|
nodiscard |
Block until at least one socket is readable, wake() is called, or timeout elapses.
Returns the ready events (empty on timeout or wake). A negative timeout blocks indefinitely.