diff options
author | Max Kellermann <max@musicpd.org> | 2019-08-26 21:04:35 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-08-26 21:04:35 +0200 |
commit | 4c7154bd23b3838ff6f97111c4215fbe2546722a (patch) | |
tree | 870367e82b8acc3fbcb29484a80df3e610f15a84 /src/filter | |
parent | 4f5c3b349decabbd79924ce543381bc406ac39af (diff) |
filter/Observer: add `noexcept`
Diffstat (limited to 'src/filter')
-rw-r--r-- | src/filter/Observer.cxx | 18 | ||||
-rw-r--r-- | src/filter/Observer.hxx | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/filter/Observer.cxx b/src/filter/Observer.cxx index 98de3d8ea..bbbc18f0a 100644 --- a/src/filter/Observer.cxx +++ b/src/filter/Observer.cxx @@ -32,23 +32,23 @@ class FilterObserver::PreparedProxy final : public PreparedFilter { public: PreparedProxy(FilterObserver &_observer, - std::unique_ptr<PreparedFilter> _prepared_filter) + std::unique_ptr<PreparedFilter> _prepared_filter) noexcept :observer(_observer), prepared_filter(std::move(_prepared_filter)) {} - ~PreparedProxy() { + ~PreparedProxy() noexcept { assert(child == nullptr); assert(observer.proxy == this); observer.proxy = nullptr; } - void Clear(gcc_unused Proxy *_child) { + void Clear(gcc_unused Proxy *_child) noexcept { assert(child == _child); child = nullptr; } - Filter *Get(); + Filter *Get() noexcept; std::unique_ptr<Filter> Open(AudioFormat &af) override; }; @@ -59,15 +59,15 @@ class FilterObserver::Proxy final : public Filter { std::unique_ptr<Filter> filter; public: - Proxy(PreparedProxy &_parent, std::unique_ptr<Filter> _filter) + Proxy(PreparedProxy &_parent, std::unique_ptr<Filter> _filter) noexcept :Filter(_filter->GetOutAudioFormat()), parent(_parent), filter(std::move(_filter)) {} - ~Proxy() { + ~Proxy() noexcept { parent.Clear(this); } - Filter *Get() { + Filter *Get() noexcept { return filter.get(); } @@ -85,7 +85,7 @@ public: }; Filter * -FilterObserver::PreparedProxy::Get() +FilterObserver::PreparedProxy::Get() noexcept { return child != nullptr ? child->Get() @@ -113,7 +113,7 @@ FilterObserver::Set(std::unique_ptr<PreparedFilter> pf) } Filter * -FilterObserver::Get() +FilterObserver::Get() noexcept { return proxy != nullptr ? proxy->Get() diff --git a/src/filter/Observer.hxx b/src/filter/Observer.hxx index 1505e2efe..6dd6096d4 100644 --- a/src/filter/Observer.hxx +++ b/src/filter/Observer.hxx @@ -41,7 +41,7 @@ public: */ std::unique_ptr<PreparedFilter> Set(std::unique_ptr<PreparedFilter> pf); - Filter *Get(); + Filter *Get() noexcept; }; #endif |