Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
24 namespace mir
25 {
26 namespace protobuf
27 {
28 namespace wire
29 {
30 class Invocation;
31 }
32 }
33 namespace frontend
34 {
35 namespace detail
36 {
38 {
39 public:
40  Invocation(mir::protobuf::wire::Invocation const& invocation) :
41  invocation(invocation) {}
42 
43  const ::std::string& method_name() const;
44  const ::std::string& parameters() const;
45  ::google::protobuf::uint32 id() const;
46 private:
47  mir::protobuf::wire::Invocation const& invocation;
48 };
49 
51 {
52 public:
53  virtual bool dispatch(Invocation const& invocation) = 0;
54 
55 protected:
56  MessageProcessor() = default;
57  virtual ~MessageProcessor() = default;
58  MessageProcessor(MessageProcessor const&) = delete;
60 };
61 }
62 }
63 }
64 #endif /* PROTOBUF_MESSAGE_PROCESSOR_H_ */
Definition: message_processor.h:37
::google::protobuf::uint32 id() const
Definition: protobuf_message_processor.cpp:116
virtual bool dispatch(Invocation const &invocation)=0
Invocation(mir::protobuf::wire::Invocation const &invocation)
Definition: message_processor.h:40
MessageProcessor & operator=(MessageProcessor const &)=delete
Definition: message_processor.h:50
const ::std::string & parameters() const
Definition: protobuf_message_processor.cpp:111
const ::std::string & method_name() const
Definition: protobuf_message_processor.cpp:106

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