From 6a3144667110497536f9f2c7608a0bee29b94556 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 20 Dec 2017 10:45:30 +0100 Subject: [PATCH] event/TimerEvent: add "noexcept" --- src/event/TimerEvent.cxx | 4 ++-- src/event/TimerEvent.hxx | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/event/TimerEvent.cxx b/src/event/TimerEvent.cxx index 0943d8a34..998bff73b 100644 --- a/src/event/TimerEvent.cxx +++ b/src/event/TimerEvent.cxx @@ -22,14 +22,14 @@ #include "Loop.hxx" void -TimerEvent::Cancel() +TimerEvent::Cancel() noexcept { if (IsActive()) loop.CancelTimer(*this); } void -TimerEvent::Schedule(std::chrono::steady_clock::duration d) +TimerEvent::Schedule(std::chrono::steady_clock::duration d) noexcept { Cancel(); diff --git a/src/event/TimerEvent.hxx b/src/event/TimerEvent.hxx index 55d2ce4c8..ad017942b 100644 --- a/src/event/TimerEvent.hxx +++ b/src/event/TimerEvent.hxx @@ -55,27 +55,27 @@ class TimerEvent final { std::chrono::steady_clock::time_point due; public: - TimerEvent(EventLoop &_loop, Callback _callback) + TimerEvent(EventLoop &_loop, Callback _callback) noexcept :loop(_loop), callback(_callback) { } - ~TimerEvent() { + ~TimerEvent() noexcept { Cancel(); } - EventLoop &GetEventLoop() { + EventLoop &GetEventLoop() noexcept { return loop; } - bool IsActive() const { + bool IsActive() const noexcept { return timer_set_hook.is_linked(); } - void Schedule(std::chrono::steady_clock::duration d); - void Cancel(); + void Schedule(std::chrono::steady_clock::duration d) noexcept; + void Cancel() noexcept; private: - void Run() { + void Run() noexcept { callback(); } };