summaryrefslogtreecommitdiffstats
path: root/src/sdevent.hpp
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-10-19 15:56:09 -0700
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-12-06 14:00:26 +0000
commit223c40931e4f413431ab2f84d92c5f404e2d9cf2 (patch)
treefae46d08b8e00a2f0d34b62638ab090cd3831c3d /src/sdevent.hpp
parentecf8910c014b94c688d08fa856cd22ec365583fa (diff)
downloadphosphor-dbus-monitor-223c40931e4f413431ab2f84d92c5f404e2d9cf2.tar.gz
phosphor-dbus-monitor-223c40931e4f413431ab2f84d92c5f404e2d9cf2.zip
sdevent: Remove in favor of sdeventplus
This change removes the one off sd-event wrapper from the project and uses the openbmc wide sdeventplus library. Change-Id: I8e042f875d06082e15606c7191a8073974f93990 Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'src/sdevent.hpp')
-rw-r--r--src/sdevent.hpp87
1 files changed, 0 insertions, 87 deletions
diff --git a/src/sdevent.hpp b/src/sdevent.hpp
deleted file mode 100644
index 4fed159..0000000
--- a/src/sdevent.hpp
+++ /dev/null
@@ -1,87 +0,0 @@
-#pragma once
-
-#include "sdevent/event.hpp"
-#include "sdevent/timer.hpp"
-
-struct Loop;
-
-namespace phosphor
-{
-namespace dbus
-{
-namespace monitoring
-{
-
-/** @class SDEvent
- * @brief SDEventType access delegate implementation for sdevent.
- */
-class SDEvent
-{
- protected:
- /** @brief Share a single event loop amongst users. */
- static auto& getEvent()
- {
- static auto event = sdevent::event::newDefault();
- return event;
- }
-
- public:
- /** @brief Wrapper for sd_event_now. */
- static auto now()
- {
- return getEvent().now();
- }
-
- friend Loop;
-};
-
-/** @class SDEventTimer
- * @brief TimerType access delegate implementation for sdevent.
- */
-class SDEventTimer : public SDEvent
-{
- public:
- SDEventTimer() = delete;
- SDEventTimer(const SDEventTimer&) = default;
- SDEventTimer(SDEventTimer&&) = default;
- SDEventTimer& operator=(const SDEventTimer&) = default;
- SDEventTimer& operator=(SDEventTimer&&) = default;
- ~SDEventTimer() = default;
-
- explicit SDEventTimer(
- const sdevent::event::timer::Timer::Callback& callback) :
- timer(getEvent(), callback)
- {
- }
-
- /** @brief Update a timer expiration. */
- void update(const std::chrono::steady_clock::time_point& expires)
- {
- timer.setTime(expires);
- }
-
- /** @brief Query timer state. */
- auto enabled()
- {
- return timer.enabled() != SD_EVENT_OFF;
- }
-
- /** @brief Enable a timer. */
- void enable()
- {
- timer.enable(SD_EVENT_ONESHOT);
- }
-
- /** @brief Disable a timer. */
- void disable()
- {
- timer.enable(SD_EVENT_OFF);
- }
-
- private:
- sdevent::event::timer::Timer timer;
-};
-
-} // namespace monitoring
-} // namespace dbus
-} // namespace phosphor
OpenPOWER on IntegriCloud