summaryrefslogtreecommitdiffstats
path: root/control/types.hpp
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-10-30 19:49:29 -0700
committerMatthew Barth <msbarth@linux.ibm.com>2019-02-05 16:20:02 +0000
commit8fd879fb7bb9ed34fe69581dc714b4158046519f (patch)
treeaa33e860d7d018fd9670599039e459a4bebc6324 /control/types.hpp
parenta1aef7a100a9b27d2133622a695bb8c09c2869bf (diff)
downloadphosphor-fan-presence-8fd879fb7bb9ed34fe69581dc714b4158046519f.tar.gz
phosphor-fan-presence-8fd879fb7bb9ed34fe69581dc714b4158046519f.zip
Remove timer in favor of sdeventplus/utility/timer
This removes the custom timer implementation and moves to the sdeventplus utility. Functionally this should make no change Tested: Built and run through the unit test suite. Change-Id: Ib7ee90d489d5db72496aaaca91c3cf5490ad47d6 Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'control/types.hpp')
-rw-r--r--control/types.hpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/control/types.hpp b/control/types.hpp
index 967b0b4..239d00d 100644
--- a/control/types.hpp
+++ b/control/types.hpp
@@ -3,7 +3,8 @@
#include <tuple>
#include <vector>
#include <sdbusplus/server.hpp>
-#include "timer.hpp"
+#include <sdeventplus/clock.hpp>
+#include <sdeventplus/utility/timer.hpp>
namespace phosphor
{
@@ -64,7 +65,11 @@ using Service = std::tuple<std::string, bool>;
constexpr auto intervalPos = 0;
constexpr auto typePos = 1;
-using TimerType = phosphor::fan::util::Timer::TimerType;
+enum class TimerType
+{
+ oneshot,
+ repeating,
+};
using TimerConf = std::tuple<std::chrono::seconds,
TimerType>;
@@ -89,9 +94,8 @@ using EventData = std::tuple<Group, std::string, Handler, std::vector<Action>>;
constexpr auto timerEventDataPos = 0;
constexpr auto timerTimerPos = 1;
-using TimerEvent =
- std::tuple<std::unique_ptr<EventData>,
- std::unique_ptr<phosphor::fan::util::Timer>>;
+using Timer = sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic>;
+using TimerEvent = std::tuple<std::unique_ptr<EventData>, Timer>;
constexpr auto signalEventDataPos = 0;
constexpr auto signalMatchPos = 1;
OpenPOWER on IntegriCloud