Mir
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 #ifndef MIR_FRONTEND_MESSAGE_PROCESSOR_H_
20 #define MIR_FRONTEND_MESSAGE_PROCESSOR_H_
21 
22 #include <google/protobuf/stubs/common.h>
23 
24 #include <mir/fd.h>
25 #include <vector>
26 
27 namespace mir
28 {
29 namespace protobuf
30 {
31 namespace wire
32 {
33 class Invocation;
34 }
35 }
36 namespace frontend
37 {
38 namespace detail
39 {
41 {
42 public:
43  Invocation(mir::protobuf::wire::Invocation const& invocation) :
44  invocation(invocation) {}
45 
46  const ::std::string& method_name() const;
47  const ::std::string& parameters() const;
48  google::protobuf::uint32 id() const;
49 private:
50  mir::protobuf::wire::Invocation const& invocation;
51 };
52 
54 {
55 public:
56  virtual bool dispatch(Invocation const& invocation, std::vector<mir::Fd> const& side_channel_fds) = 0;
57  virtual void client_pid(int pid) = 0;
58 
59 protected:
60  MessageProcessor() = default;
61  virtual ~MessageProcessor() = default;
62  MessageProcessor(MessageProcessor const&) = delete;
63  MessageProcessor& operator=(MessageProcessor const&) = delete;
64 };
65 }
66 }
67 }
68 #endif /* PROTOBUF_MESSAGE_PROCESSOR_H_ */
All things Mir.
Definition: atomic_callback.h:25
Definition: message_processor.h:40
Invocation(mir::protobuf::wire::Invocation const &invocation)
Definition: message_processor.h:43
Definition: message_processor.h:53

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