Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 protobuf { class DisplayServer; }
32 
33 namespace frontend
34 {
35 class MessageProcessorReport;
36 
37 namespace detail
38 {
39 class ProtobufMessageSender;
40 
42 {
43 public:
45  std::shared_ptr<ProtobufMessageSender> const& sender,
46  std::shared_ptr<protobuf::DisplayServer> const& display_server,
47  std::shared_ptr<MessageProcessorReport> const& report);
48 
50 
51  void send_response(::google::protobuf::uint32 id, ::google::protobuf::Message* response);
52  void send_response(::google::protobuf::uint32 id, protobuf::Buffer* response);
53  void send_response(::google::protobuf::uint32 id, protobuf::Connection* response);
54  void send_response(::google::protobuf::uint32 id, protobuf::Surface* response);
55  void send_response(::google::protobuf::uint32 id, std::shared_ptr<protobuf::Buffer> response);
56  void send_response(::google::protobuf::uint32 id, mir::protobuf::Screencast* response);
57 
58 private:
59  bool dispatch(Invocation const& invocation);
60 
61  std::shared_ptr<ProtobufMessageSender> const sender;
62  std::shared_ptr<protobuf::DisplayServer> const display_server;
63  std::shared_ptr<MessageProcessorReport> const report;
64 };
65 }
66 }
67 }
68 
69 #endif /* PROTOBUF_MESSAGE_PROCESSOR_H_ */
Definition: message_processor.h:37
Definition: protobuf_message_processor.h:41
Definition: message_processor.h:50
void send_response(::google::protobuf::uint32 id,::google::protobuf::Message *response)
Definition: protobuf_message_processor.cpp:198
ProtobufMessageProcessor(std::shared_ptr< ProtobufMessageSender > const &sender, std::shared_ptr< protobuf::DisplayServer > const &display_server, std::shared_ptr< MessageProcessorReport > const &report)
Definition: protobuf_message_processor.cpp:40
~ProtobufMessageProcessor() noexcept
Definition: protobuf_message_processor.h:49

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014