Mir
protobuf_message_processor.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012. 2014 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 
20 #ifndef MIR_FRONTEND_PROTOBUF_MESSAGE_PROCESSOR_H_
21 #define MIR_FRONTEND_PROTOBUF_MESSAGE_PROCESSOR_H_
22 
24 
25 #include "mir_protobuf.pb.h"
26 
27 #include <memory>
28 
29 namespace mir
30 {
31 namespace frontend
32 {
33 class MessageProcessorReport;
34 
35 namespace detail
36 {
37 class DisplayServer;
38 class ProtobufMessageSender;
39 
41  public std::enable_shared_from_this<ProtobufMessageProcessor>
42 {
43 public:
45  std::shared_ptr<ProtobufMessageSender> const& sender,
46  std::shared_ptr<DisplayServer> const& display_server,
47  std::shared_ptr<MessageProcessorReport> const& report);
48 
50 
51  void client_pid(int pid) override;
52 
53  void send_response(::google::protobuf::uint32 id, ::google::protobuf::Message* response);
54  void send_response(::google::protobuf::uint32 id, protobuf::Buffer* response);
55  void send_response(::google::protobuf::uint32 id, protobuf::Connection* response);
56  void send_response(::google::protobuf::uint32 id, protobuf::Surface* response);
57  void send_response(::google::protobuf::uint32 id, std::shared_ptr<protobuf::Buffer> response);
58  void send_response(::google::protobuf::uint32 id, mir::protobuf::Screencast* response);
59  void send_response(::google::protobuf::uint32 id, mir::protobuf::SocketFD* response);
60  void send_response(::google::protobuf::uint32 id, std::shared_ptr<protobuf::PlatformOperationMessage> response);
61 
62 private:
63  bool dispatch(Invocation const& invocation, std::vector<mir::Fd> const& side_channel_fds) override;
64 
65  std::shared_ptr<ProtobufMessageSender> const sender;
66  std::shared_ptr<DisplayServer> const display_server;
67  std::shared_ptr<MessageProcessorReport> const report;
68 };
69 }
70 }
71 }
72 
73 #endif /* PROTOBUF_MESSAGE_PROCESSOR_H_ */
All things Mir.
Definition: buffer_stream.h:37
Definition: message_processor.h:39
Definition: protobuf_message_processor.h:40
Definition: message_processor.h:52
void send_response(::google::protobuf::uint32 id,::google::protobuf::Message *response)
ProtobufMessageProcessor(std::shared_ptr< ProtobufMessageSender > const &sender, std::shared_ptr< DisplayServer > const &display_server, std::shared_ptr< MessageProcessorReport > const &report)
~ProtobufMessageProcessor() noexcept
Definition: protobuf_message_processor.h:49

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015