Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rpc_report.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License version 3 as
6  * 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 Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17  */
18 
19 #ifndef MIR_CLIENT_RPC_RPC_REPORT_H_
20 #define MIR_CLIENT_RPC_RPC_REPORT_H_
21 
22 #include <mir_toolkit/event.h>
23 #include <boost/system/error_code.hpp>
24 #include <google/protobuf/message.h>
25 
26 namespace mir
27 {
28 namespace protobuf
29 {
30 class Event;
31 
32 namespace wire
33 {
34 class Invocation;
35 class Result;
36 }
37 }
38 namespace client
39 {
40 namespace rpc
41 {
42 
43 class RpcReport
44 {
45 public:
46  virtual ~RpcReport() = default;
47 
48  virtual void invocation_requested(mir::protobuf::wire::Invocation const& invocation) = 0;
49  virtual void invocation_succeeded(mir::protobuf::wire::Invocation const& invocation) = 0;
50  virtual void invocation_failed(mir::protobuf::wire::Invocation const& invocation,
51  boost::system::error_code const& error) = 0;
52 
53  virtual void header_receipt_failed(boost::system::error_code const& error) = 0;
54  virtual void result_receipt_succeeded(mir::protobuf::wire::Result const& result) = 0;
55  virtual void result_receipt_failed(std::exception const& ex) = 0;
56 
57  virtual void event_parsing_succeeded(MirEvent const& event) = 0;
58  virtual void event_parsing_failed(mir::protobuf::Event const& event) = 0;
59 
60  virtual void orphaned_result(mir::protobuf::wire::Result const& result) = 0;
61  virtual void complete_response(mir::protobuf::wire::Result const& result) = 0;
62 
63  virtual void result_processing_failed(mir::protobuf::wire::Result const& result,
64  std::exception const& ex) = 0;
65 
66  virtual void file_descriptors_received(google::protobuf::Message const& response,
67  std::vector<int32_t> const& fds) = 0;
68 
69  virtual void connection_failure(std::exception const& ex) = 0;
70 
71 protected:
72  RpcReport() = default;
73  RpcReport(RpcReport const&) = delete;
74  RpcReport& operator=(RpcReport const&) = delete;
75 };
76 
77 }
78 }
79 }
80 
81 #endif /* MIR_CLIENT_RPC_RPC_REPORT_H_ */

Copyright © 2012,2013 Canonical Ltd.
Generated on Wed Oct 30 18:52:19 UTC 2013