blob: aca64d82a0ba1c44a9e6c58ee6c91e1f445791d0 [file] [log] [blame]
Matthew Barth1febc282017-04-12 11:33:39 -05001#pragma once
2
3#include <sdbusplus/bus.hpp>
4#include <sdbusplus/server.hpp>
5#include "events.hpp"
6
7namespace phosphor
8{
9namespace dbus
10{
11namespace monitoring
12{
13
14class Monitor
15{
16 public:
17 Monitor() = delete;
18 Monitor(const Monitor&) = delete;
19 Monitor(Monitor&&) = default;
20 Monitor& operator=(const Monitor&) = delete;
21 Monitor& operator=(Monitor&&) = default;
22 ~Monitor() = default;
23
24 explicit Monitor(sdbusplus::bus::bus& bus);
25
Matthew Barthe6af2332017-04-12 13:37:29 -050026 void processStart() noexcept;
27
28 void handleEvent(sdbusplus::message::message& msg,
29 const Event& event,
30 const std::tuple<std::vector<std::shared_ptr<Event>>,
31 std::vector<Action>>& eventDef);
32
Matthew Barth1febc282017-04-12 11:33:39 -050033 private:
34 sdbusplus::bus::bus& bus;
35
Matthew Barthe6af2332017-04-12 13:37:29 -050036 static const std::vector<
37 std::tuple<std::vector<std::shared_ptr<Event>>,
38 std::vector<Action>>> events;
39
Matthew Barth1febc282017-04-12 11:33:39 -050040};
41
42} // namespace monitoring
43} // namespace dbus
44} // namespace phosphor