event/IdleMonitor: add "noexcept"

This commit is contained in:
Max Kellermann 2017-11-12 17:40:25 +01:00
parent b57e2f5521
commit cf483107c9
9 changed files with 19 additions and 19 deletions

View File

@ -145,7 +145,7 @@ private:
bool OnSocketReady(unsigned flags) noexcept override;
/* virtual methods from IdleMonitor */
void OnIdle() override;
void OnIdle() noexcept override;
};
static constexpr struct {
@ -488,7 +488,7 @@ ProxyDatabase::OnSocketReady(gcc_unused unsigned flags) noexcept
}
void
ProxyDatabase::OnIdle()
ProxyDatabase::OnIdle() noexcept
{
assert(connection != nullptr);

View File

@ -110,7 +110,7 @@ FullyBufferedSocket::OnSocketReady(unsigned flags) noexcept
}
void
FullyBufferedSocket::OnIdle()
FullyBufferedSocket::OnIdle() noexcept
{
if (Flush() && !output.empty())
ScheduleWrite();

View File

@ -64,7 +64,7 @@ protected:
/* virtual methods from class SocketMonitor */
bool OnSocketReady(unsigned flags) noexcept override;
virtual void OnIdle() override;
virtual void OnIdle() noexcept override;
};
#endif

View File

@ -24,7 +24,7 @@
#include <assert.h>
void
IdleMonitor::Cancel()
IdleMonitor::Cancel() noexcept
{
assert(loop.IsInside());
@ -35,7 +35,7 @@ IdleMonitor::Cancel()
}
void
IdleMonitor::Schedule()
IdleMonitor::Schedule() noexcept
{
assert(loop.IsInside());
@ -47,7 +47,7 @@ IdleMonitor::Schedule()
}
void
IdleMonitor::Run()
IdleMonitor::Run() noexcept
{
assert(loop.IsInside());

View File

@ -43,10 +43,10 @@ class IdleMonitor {
EventLoop &loop;
public:
IdleMonitor(EventLoop &_loop)
explicit IdleMonitor(EventLoop &_loop) noexcept
:loop(_loop) {}
~IdleMonitor() {
~IdleMonitor() noexcept {
#ifndef NDEBUG
/* this check is redundant, it is only here to avoid
the assertion in Cancel() */
@ -55,22 +55,22 @@ public:
Cancel();
}
EventLoop &GetEventLoop() const {
EventLoop &GetEventLoop() const noexcept {
return loop;
}
bool IsActive() const {
bool IsActive() const noexcept {
return list_hook.is_linked();
}
void Schedule();
void Cancel();
void Schedule() noexcept;
void Cancel() noexcept;
protected:
virtual void OnIdle() = 0;
virtual void OnIdle() noexcept = 0;
private:
void Run();
void Run() noexcept;
};
#endif /* MAIN_NOTIFY_H */

View File

@ -89,7 +89,7 @@ MultiSocketMonitor::Prepare()
}
void
MultiSocketMonitor::OnIdle()
MultiSocketMonitor::OnIdle() noexcept
{
if (ready) {
ready = false;

View File

@ -223,7 +223,7 @@ private:
IdleMonitor::Schedule();
}
virtual void OnIdle() final;
virtual void OnIdle() noexcept final;
};
#endif

View File

@ -110,7 +110,7 @@ NfsManager::CollectGarbage()
}
void
NfsManager::OnIdle()
NfsManager::OnIdle() noexcept
{
CollectGarbage();
}

View File

@ -116,7 +116,7 @@ private:
void CollectGarbage();
/* virtual methods from IdleMonitor */
void OnIdle() override;
void OnIdle() noexcept override;
};
#endif