From 1febc28a1b9b72c805b74c28c8b505e292591fc5 Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Wed, 12 Apr 2017 11:33:39 -0500 Subject: Create phosphor-dbus-monitor application Application is created allowing for a log_error action to be performed Change-Id: I6890fff7ace708e80c79607beceedc926c05ec3d Signed-off-by: Matthew Barth --- src/Makefile.am | 14 ++++++++++++++ src/main.cpp | 18 ++++++++++++++++++ src/monitor.cpp | 18 ++++++++++++++++++ src/monitor.hpp | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 src/Makefile.am create mode 100644 src/main.cpp create mode 100644 src/monitor.cpp create mode 100644 src/monitor.hpp (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..b9c857c --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,14 @@ +AM_DEFAULT_SOURCE_EXT = .cpp +AM_CPPFLAGS = -iquote ${top_srcdir} + +sbin_PROGRAMS = phosphor-dbus-monitor + +phosphor_dbus_monitor_SOURCES = \ + main.cpp \ + monitor.cpp +phosphor_dbus_monitor_LDADD = \ + $(SDBUSPLUS_LIBS) \ + $(PHOSPHOR_LOGGING_LIBS) +phosphor_dbus_monitor_CXXFLAGS = \ + $(SDBUSPLUS_CFLAGS) \ + $(PHOSPHOR_LOGGING_CFLAGS) diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..6d1a071 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,18 @@ +#include +#include "monitor.hpp" + +int main(void) +{ + auto bus = sdbusplus::bus::new_default(); + + phosphor::dbus::monitoring::Monitor monitor(bus); + + // Keep application running + while (true) + { + bus.process_discard(); + bus.wait(); + } + + return -1; +} diff --git a/src/monitor.cpp b/src/monitor.cpp new file mode 100644 index 0000000..f734b00 --- /dev/null +++ b/src/monitor.cpp @@ -0,0 +1,18 @@ +#include "monitor.hpp" + +namespace phosphor +{ +namespace dbus +{ +namespace monitoring +{ + +Monitor::Monitor(sdbusplus::bus::bus& bus) : + bus(bus) +{ + +} + +} // namespace monitoring +} // namespace dbus +} // namespace phosphor diff --git a/src/monitor.hpp b/src/monitor.hpp new file mode 100644 index 0000000..2fc91b5 --- /dev/null +++ b/src/monitor.hpp @@ -0,0 +1,33 @@ +#pragma once + +#include +#include +#include "events.hpp" + +namespace phosphor +{ +namespace dbus +{ +namespace monitoring +{ + +class Monitor +{ + public: + Monitor() = delete; + Monitor(const Monitor&) = delete; + Monitor(Monitor&&) = default; + Monitor& operator=(const Monitor&) = delete; + Monitor& operator=(Monitor&&) = default; + ~Monitor() = default; + + explicit Monitor(sdbusplus::bus::bus& bus); + + private: + sdbusplus::bus::bus& bus; + +}; + +} // namespace monitoring +} // namespace dbus +} // namespace phosphor -- cgit v1.2.1