summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am14
-rw-r--r--src/main.cpp18
-rw-r--r--src/monitor.cpp18
-rw-r--r--src/monitor.hpp33
4 files changed, 83 insertions, 0 deletions
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 <sdbusplus/bus.hpp>
+#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 <sdbusplus/bus.hpp>
+#include <sdbusplus/server.hpp>
+#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
OpenPOWER on IntegriCloud