Mir
Public Member Functions | List of all members
mir::dispatch::ActionQueue Class Reference

#include <action_queue.h>

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

Public Member Functions

 ActionQueue ()
 
Fd watch_fd () const override
 Get a poll()able file descriptor. More...
 
void enqueue (std::function< void()> const &action)
 
bool dispatch (FdEvents events) override
 Dispatch one pending event. More...
 
FdEvents relevant_events () const override
 The set of file-descriptor events this Dispatchable handles. More...
 
- Public Member Functions inherited from mir::dispatch::Dispatchable
 Dispatchable ()=default
 
virtual ~Dispatchable ()=default
 
Dispatchableoperator= (Dispatchable const &)=delete
 
 Dispatchable (Dispatchable const &)=delete
 

Constructor & Destructor Documentation

mir::dispatch::ActionQueue::ActionQueue ( )

Member Function Documentation

bool mir::dispatch::ActionQueue::dispatch ( FdEvents  events)
overridevirtual

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.

Implements mir::dispatch::Dispatchable.

void mir::dispatch::ActionQueue::enqueue ( std::function< void()> const &  action)
FdEvents mir::dispatch::ActionQueue::relevant_events ( ) const
overridevirtual

The set of file-descriptor events this Dispatchable handles.

Implements mir::dispatch::Dispatchable.

Fd mir::dispatch::ActionQueue::watch_fd ( ) const
overridevirtual

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.

Implements mir::dispatch::Dispatchable.


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

Copyright © 2012-2016 Canonical Ltd.
Generated on Tue Oct 31 05:57:28 UTC 2017