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

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