Mir
Public Member Functions | List of all members
mir::dispatch::Dispatchable Class Referenceabstract

#include <dispatchable.h>

Inheritance diagram for mir::dispatch::Dispatchable:
[legend]

Public Member Functions

 Dispatchable ()=default
 
virtual ~Dispatchable ()=default
 
Dispatchableoperator= (Dispatchable const &)=delete
 
 Dispatchable (Dispatchable const &)=delete
 
virtual Fd watch_fd () const =0
 Get a poll()able file descriptor. More...
 
virtual bool dispatch (FdEvents events)=0
 Dispatch one pending event. More...
 
virtual FdEvents relevant_events () const =0
 The set of file-descriptor events this Dispatchable handles. More...
 

Constructor & Destructor Documentation

◆ Dispatchable() [1/2]

mir::dispatch::Dispatchable::Dispatchable ( )
default

◆ ~Dispatchable()

virtual mir::dispatch::Dispatchable::~Dispatchable ( )
virtualdefault

◆ Dispatchable() [2/2]

mir::dispatch::Dispatchable::Dispatchable ( Dispatchable const &  )
delete

Member Function Documentation

◆ dispatch()

virtual bool mir::dispatch::Dispatchable::dispatch ( FdEvents  events)
pure virtual

Dispatch one pending event.

Parameters
[in]eventsThe 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.
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.
An implementation of dispatch() MUST handle FdEvent::error, if only to return false and terminate further event dispatch.

Implemented in mir::dispatch::MultiplexingDispatchable, mir::dispatch::ActionQueue, and mir::dispatch::ReadableFd.

◆ operator=()

Dispatchable& mir::dispatch::Dispatchable::operator= ( Dispatchable const &  )
delete

◆ relevant_events()

virtual FdEvents mir::dispatch::Dispatchable::relevant_events ( ) const
pure virtual

The set of file-descriptor events this Dispatchable handles.

Implemented in mir::dispatch::MultiplexingDispatchable, mir::dispatch::ActionQueue, and mir::dispatch::ReadableFd.

◆ watch_fd()

virtual Fd mir::dispatch::Dispatchable::watch_fd ( ) const
pure virtual

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.

Implemented in mir::dispatch::MultiplexingDispatchable, mir::dispatch::ActionQueue, and mir::dispatch::ReadableFd.


The documentation for this class was generated from the following file:

Copyright © 2012-2018 Canonical Ltd.
Generated on Tue Feb 20 03:16:44 UTC 2018