Class Dispatchable¶
Defined in File dispatchable.h
Inheritance Relationships¶
Derived Types¶
public mir::dispatch::ActionQueue
(Class ActionQueue)public mir::dispatch::MultiplexingDispatchable
(Class MultiplexingDispatchable)public mir::dispatch::ReadableFd
(Class ReadableFd)
Class Documentation¶
-
class Dispatchable¶
Subclassed by mir::dispatch::ActionQueue, mir::dispatch::MultiplexingDispatchable, mir::dispatch::ReadableFd
Public Functions
-
Dispatchable() = default¶
-
virtual ~Dispatchable() = default¶
-
Dispatchable &operator=(Dispatchable const&) = delete¶
-
Dispatchable(Dispatchable const&) = delete¶
-
virtual Fd watch_fd() const = 0¶
Get a poll()able file descriptor.
- Returns:
A file descriptor usable with poll() or equivalent function calls. relevant_events() contains the set of event types to watch for.
-
virtual bool dispatch(FdEvents events) = 0¶
Dispatch one pending event.
- Parameters:
events – [in] The set of events current on the file-descriptor
- Returns:
False iff no more events will be produced by this Dispatchable. Dispatch should no longer be called.
Note
This will dispatch at most one event. If there are multiple events specified in
events
(eg: readable | remote_closed) then dispatch will process only one.Note
It is harmless to call dispatch() with an event that does not contain any of the events from relevant_events(). The function will do nothing in such a case.
Note
An implementation of dispatch() MUST handle FdEvent::error, if only to return false and terminate further event dispatch.
-
virtual FdEvents relevant_events() const = 0¶
The set of file-descriptor events this Dispatchable handles.
-
Dispatchable() = default¶