Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 {
42 public:
44  std::shared_ptr<ProtobufMessageSender> const& sender,
45  std::shared_ptr<DisplayServer> const& display_server,
46  std::shared_ptr<MessageProcessorReport> const& report);
47 
49 
50  void client_pid(int pid) override;
51 
52  void send_response(::google::protobuf::uint32 id, ::google::protobuf::Message* response);
53  void send_response(::google::protobuf::uint32 id, protobuf::Buffer* response);
54  void send_response(::google::protobuf::uint32 id, protobuf::Connection* response);
55  void send_response(::google::protobuf::uint32 id, protobuf::Surface* response);
56  void send_response(::google::protobuf::uint32 id, std::shared_ptr<protobuf::Buffer> response);
57  void send_response(::google::protobuf::uint32 id, mir::protobuf::Screencast* response);
58  void send_response(::google::protobuf::uint32 id, mir::protobuf::SocketFD* response);
59 
60 private:
61  bool dispatch(Invocation const& invocation);
62 
63  std::shared_ptr<ProtobufMessageSender> const sender;
64  std::shared_ptr<DisplayServer> const display_server;
65  std::shared_ptr<MessageProcessorReport> const report;
66 };
67 }
68 }
69 }
70 
71 #endif /* PROTOBUF_MESSAGE_PROCESSOR_H_ */
Definition: mir_protobuf.pb.h:1453
All things Mir.
Definition: aging_buffer.h:24
Definition: message_processor.h:37
Definition: protobuf_message_processor.h:40
Definition: mir_protobuf.pb.h:2769
Definition: mir_protobuf.pb.h:3061
Definition: message_processor.h:50
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)
Definition: mir_protobuf.pb.h:471
~ProtobufMessageProcessor() noexcept
Definition: protobuf_message_processor.h:48
Definition: mir_protobuf.pb.h:1304

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Oct 10 14:07:14 UTC 2014