19 #ifndef MIR_CLIENT_RPC_MIR_PROTOBUF_RPC_CHANNEL_H_
20 #define MIR_CLIENT_RPC_MIR_PROTOBUF_RPC_CHANNEL_H_
25 #include <google/protobuf/service.h>
26 #include <google/protobuf/descriptor.h>
44 class DisplayConfiguration;
46 class LifecycleControl;
59 std::shared_ptr<SurfaceMap>
const& surface_map,
60 std::shared_ptr<DisplayConfiguration>
const& disp_config,
61 std::shared_ptr<RpcReport>
const& rpc_report,
62 std::shared_ptr<LifecycleControl>
const& lifecycle_control,
63 std::shared_ptr<EventSink>
const& event_sink);
70 virtual void CallMethod(
const google::protobuf::MethodDescriptor* method, google::protobuf::RpcController*,
71 const google::protobuf::Message* parameters, google::protobuf::Message* response,
72 google::protobuf::Closure* complete);
74 std::shared_ptr<RpcReport>
const rpc_report;
77 static constexpr
size_t size_of_header = 2;
81 void receive_file_descriptors(google::protobuf::Message* response, google::protobuf::Closure* complete);
82 template<
class MessageType>
83 void receive_any_file_descriptors_for(MessageType* response);
88 void process_event_sequence(std::string
const& event);
90 void notify_disconnected();
92 std::shared_ptr<SurfaceMap> surface_map;
93 std::shared_ptr<DisplayConfiguration> display_configuration;
94 std::shared_ptr<LifecycleControl> lifecycle_control;
95 std::shared_ptr<EventSink> event_sink;
96 std::atomic<bool> disconnected;
97 std::mutex read_mutex;
98 std::mutex write_mutex;
107 std::unique_ptr<StreamTransport> transport;
All things Mir.
Definition: aging_buffer.h:24
Definition: mir_protobuf_wire.pb.h:43
void on_disconnected() override
Called by the Transport when the connection to the server has been broken.
Definition: mir_protobuf_rpc_channel.cpp:324
~MirProtobufRpcChannel()=default
Definition: mir_basic_rpc_channel.h:52
Definition: mir_basic_rpc_channel.h:91
MirProtobufRpcChannel(std::unique_ptr< StreamTransport > transport, std::shared_ptr< SurfaceMap > const &surface_map, std::shared_ptr< DisplayConfiguration > const &disp_config, std::shared_ptr< RpcReport > const &rpc_report, std::shared_ptr< LifecycleControl > const &lifecycle_control, std::shared_ptr< EventSink > const &event_sink)
Definition: mir_protobuf_rpc_channel.cpp:47
std::vector< uint8_t > SendBuffer
Definition: mir_basic_rpc_channel.h:50
Definition: mir_protobuf_rpc_channel.h:53
void on_data_available() override
Called by the Transport when data is available for reading.
Definition: mir_protobuf_rpc_channel.cpp:271
Observer of IO status.
Definition: stream_transport.h:86