Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
message_processor_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 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_LOGGING_MESSAGE_PROCESSOR_REPORT_H_
20 #define MIR_LOGGING_MESSAGE_PROCESSOR_REPORT_H_
21 
23 #include "mir/time/time_source.h"
24 
25 #include <memory>
26 #include <mutex>
27 #include <unordered_map>
28 
29 namespace mir
30 {
31 namespace logging
32 {
33 namespace detail
34 {
36 {
38  std::string method;
39  std::string exception;
40 };
41 
42 typedef std::unordered_map<int, InvocationDetails> Invocations;
43 
45 {
47 };
48 
49 typedef std::unordered_map<void const*, MediatorDetails> Mediators;
50 }
51 
52 class Logger;
53 
55 {
56 public:
58  std::shared_ptr<Logger> const& log,
59  std::shared_ptr<time::TimeSource> const& time_source);
60 
61  void received_invocation(void const* mediator, int id, std::string const& method);
62 
63  void completed_invocation(void const* mediator, int id, bool result);
64 
65  void unknown_method(void const* mediator, int id, std::string const& method);
66 
67  void exception_handled(void const* mediator, int id, std::exception const& error);
68 
69  void exception_handled(void const* mediator, std::exception const& error);
70 
71  void sent_event(void const* mediator, MirSurfaceEvent const& event);
72 
73  ~MessageProcessorReport() noexcept(true);
74 
75 private:
76  std::shared_ptr<Logger> const log;
77  std::shared_ptr<time::TimeSource> const time_source;
78  std::mutex mutex;
79  detail::Mediators mediators;
80 };
81 }
82 }
83 
84 #endif /* MIR_LOGGING_MESSAGE_PROCESSOR_REPORT_H_ */

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Oct 15 00:23:28 UTC 2013