logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

wayland::read_intent - Represents an intention to read from the display file descriptor.

Author

       Generated automatically by Doxygen for Wayland++ from the source code.

Version 1.0.0                                Wed May 1 2024 17:27:19                     wayland::read_intent(3)

Detailed Description

       Represents an intention to read from the display file descriptor.

       When not using the convenience method display_t::dispatch that takes care of this automatically, threads
       that want to read events from a Wayland display file descriptor must announce their intention to do so
       beforehand - in the C API, this is done using wl_display_prepare_read. This intention must then be
       resolved either by actually invoking a read from the file descriptor or cancelling.

       This RAII class makes sure that when it goes out of scope, the intent is cancelled automatically if it
       was not finalized by manually cancelling or reading before. Otherwise, it would be easy to forget
       resolving the intent e.g. when handling errors, potentially leading to a deadlock.

       Read intents can only be created by a display_t with display_t::obtain_read_intent and
       display_t::obtain_queue_read_intent.

       Undefined behavior occurs when the associated display_t or event_queue_t is destroyed when a read_intent
       has not been finalized yet.

       Definition at line 371 of file wayland-client.hpp.

Member Function Documentation

voidwayland::read_intent::cancel()
       Cancel read intent. An exception is thrown when the read intent was already finalized.

   boolwayland::read_intent::is_finalized()const
       Check whether this intent was already finalized with cancel or read.

   voidwayland::read_intent::read()
       Read events from display file descriptor. This will read events from the file descriptor for the display.
       This function does not dispatch events, it only reads and queues events into their corresponding event
       queues. If no data is avilable on the file descriptor, read() returns immediately. To dispatch events
       that may have been queued, call display_t::dispatch_pending or display_t::dispatch_queue_pending.

       An exception is thrown when the read intent was already finalized. Each read intent can only be used for
       reading once. A new one must be obtained for any further read requests.

Name

       wayland::read_intent - Represents an intention to read from the display file descriptor.

Synopsis

       #include <wayland-client.hpp>

   PublicMemberFunctions
       bool is_finalized () const
           Check whether this intent was already finalized with cancel or read.
       void cancel ()
           Cancel read intent.
       void read ()
           Read events from display file descriptor.

See Also