Mir
Public Member Functions | List of all members
mir::client::rpc::MirProtobufRpcChannel Class Reference

#include <mir_protobuf_rpc_channel.h>

Inheritance diagram for mir::client::rpc::MirProtobufRpcChannel:
[legend]

Public Member Functions

 MirProtobufRpcChannel (std::unique_ptr< StreamTransport > transport, std::shared_ptr< SurfaceMap > const &surface_map, std::shared_ptr< AsyncBufferFactory > const &buffer_factory, std::shared_ptr< DisplayConfiguration > const &disp_config, std::shared_ptr< input::InputDevices > const &input_devices, std::shared_ptr< RpcReport > const &rpc_report, std::shared_ptr< LifecycleControl > const &lifecycle_control, std::shared_ptr< PingHandler > const &ping_handler, std::shared_ptr< EventSink > const &event_sink)
 
 ~MirProtobufRpcChannel ()=default
 
void on_data_available () override
 Called by the Transport when data is available for reading. More...
 
void on_disconnected () override
 Called by the Transport when the connection to the server has been broken. More...
 
Fd watch_fd () const override
 Get a poll()able file descriptor. More...
 
bool dispatch (mir::dispatch::FdEvents events) override
 Dispatch one pending event. More...
 
mir::dispatch::FdEvents relevant_events () const override
 The set of file-descriptor events this Dispatchable handles. More...
 
void process_next_request_first ()
 Switch the RpcChannel into out-of-order mode. More...
 
void call_method (std::string const &method_name, google::protobuf::MessageLite const *parameters, google::protobuf::MessageLite *response, google::protobuf::Closure *complete) override
 
- Public Member Functions inherited from mir::client::rpc::MirBasicRpcChannel
virtual ~MirBasicRpcChannel ()
 
- Public Member Functions inherited from mir::client::rpc::StreamTransport::Observer
 Observer ()=default
 
virtual ~Observer ()=default
 
 Observer (Observer const &)=delete
 
Observeroperator= (Observer const &)=delete
 
- Public Member Functions inherited from mir::dispatch::Dispatchable
 Dispatchable ()=default
 
virtual ~Dispatchable ()=default
 
Dispatchableoperator= (Dispatchable const &)=delete
 
 Dispatchable (Dispatchable const &)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from mir::client::rpc::MirBasicRpcChannel
 MirBasicRpcChannel ()
 
mir::protobuf::wire::Invocation invocation_for (std::string const &method_name, google::protobuf::MessageLite const *request, size_t num_side_channel_fds)
 
int next_id ()
 

Constructor & Destructor Documentation

mir::client::rpc::MirProtobufRpcChannel::MirProtobufRpcChannel ( std::unique_ptr< StreamTransport transport,
std::shared_ptr< SurfaceMap > const &  surface_map,
std::shared_ptr< AsyncBufferFactory > const &  buffer_factory,
std::shared_ptr< DisplayConfiguration > const &  disp_config,
std::shared_ptr< input::InputDevices > const &  input_devices,
std::shared_ptr< RpcReport > const &  rpc_report,
std::shared_ptr< LifecycleControl > const &  lifecycle_control,
std::shared_ptr< PingHandler > const &  ping_handler,
std::shared_ptr< EventSink > const &  event_sink 
)
mir::client::rpc::MirProtobufRpcChannel::~MirProtobufRpcChannel ( )
default

Member Function Documentation

void mir::client::rpc::MirProtobufRpcChannel::call_method ( std::string const &  method_name,
google::protobuf::MessageLite const *  parameters,
google::protobuf::MessageLite *  response,
google::protobuf::Closure *  complete 
)
overridevirtual
bool mir::client::rpc::MirProtobufRpcChannel::dispatch ( mir::dispatch::FdEvents  events)
overridevirtual

Dispatch one pending event.

Parameters
[in]eventThe 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 event (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::client::rpc::MirProtobufRpcChannel::on_data_available ( )
overridevirtual

Called by the Transport when data is available for reading.

Implements mir::client::rpc::StreamTransport::Observer.

void mir::client::rpc::MirProtobufRpcChannel::on_disconnected ( )
overridevirtual

Called by the Transport when the connection to the server has been broken.

Note
This is not guaranteed to be triggered exactly once; it may not fire during destruction of the Transport, or it may fire multiple times.

Implements mir::client::rpc::StreamTransport::Observer.

void mir::client::rpc::MirProtobufRpcChannel::process_next_request_first ( )

Switch the RpcChannel into out-of-order mode.

The first CallMethod after this method is called will be processed out of order - no server responses will be processed until the response for the next CallMethod is processed.

After the response for the next CallMethod is processed, normal processing is resumed.

No messages are discarded, only delayed.

md::FdEvents mir::client::rpc::MirProtobufRpcChannel::relevant_events ( ) const
overridevirtual

The set of file-descriptor events this Dispatchable handles.

Implements mir::dispatch::Dispatchable.

mir::Fd mir::client::rpc::MirProtobufRpcChannel::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 files:

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016