filter/Observer: add noexcept
This commit is contained in:
parent
4f5c3b349d
commit
4c7154bd23
@ -32,23 +32,23 @@ class FilterObserver::PreparedProxy final : public PreparedFilter {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
PreparedProxy(FilterObserver &_observer,
|
PreparedProxy(FilterObserver &_observer,
|
||||||
std::unique_ptr<PreparedFilter> _prepared_filter)
|
std::unique_ptr<PreparedFilter> _prepared_filter) noexcept
|
||||||
:observer(_observer),
|
:observer(_observer),
|
||||||
prepared_filter(std::move(_prepared_filter)) {}
|
prepared_filter(std::move(_prepared_filter)) {}
|
||||||
|
|
||||||
~PreparedProxy() {
|
~PreparedProxy() noexcept {
|
||||||
assert(child == nullptr);
|
assert(child == nullptr);
|
||||||
assert(observer.proxy == this);
|
assert(observer.proxy == this);
|
||||||
|
|
||||||
observer.proxy = nullptr;
|
observer.proxy = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Clear(gcc_unused Proxy *_child) {
|
void Clear(gcc_unused Proxy *_child) noexcept {
|
||||||
assert(child == _child);
|
assert(child == _child);
|
||||||
child = nullptr;
|
child = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Filter *Get();
|
Filter *Get() noexcept;
|
||||||
|
|
||||||
std::unique_ptr<Filter> Open(AudioFormat &af) override;
|
std::unique_ptr<Filter> Open(AudioFormat &af) override;
|
||||||
};
|
};
|
||||||
@ -59,15 +59,15 @@ class FilterObserver::Proxy final : public Filter {
|
|||||||
std::unique_ptr<Filter> filter;
|
std::unique_ptr<Filter> filter;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Proxy(PreparedProxy &_parent, std::unique_ptr<Filter> _filter)
|
Proxy(PreparedProxy &_parent, std::unique_ptr<Filter> _filter) noexcept
|
||||||
:Filter(_filter->GetOutAudioFormat()),
|
:Filter(_filter->GetOutAudioFormat()),
|
||||||
parent(_parent), filter(std::move(_filter)) {}
|
parent(_parent), filter(std::move(_filter)) {}
|
||||||
|
|
||||||
~Proxy() {
|
~Proxy() noexcept {
|
||||||
parent.Clear(this);
|
parent.Clear(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Filter *Get() {
|
Filter *Get() noexcept {
|
||||||
return filter.get();
|
return filter.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
Filter *
|
Filter *
|
||||||
FilterObserver::PreparedProxy::Get()
|
FilterObserver::PreparedProxy::Get() noexcept
|
||||||
{
|
{
|
||||||
return child != nullptr
|
return child != nullptr
|
||||||
? child->Get()
|
? child->Get()
|
||||||
@ -113,7 +113,7 @@ FilterObserver::Set(std::unique_ptr<PreparedFilter> pf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Filter *
|
Filter *
|
||||||
FilterObserver::Get()
|
FilterObserver::Get() noexcept
|
||||||
{
|
{
|
||||||
return proxy != nullptr
|
return proxy != nullptr
|
||||||
? proxy->Get()
|
? proxy->Get()
|
||||||
|
@ -41,7 +41,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
std::unique_ptr<PreparedFilter> Set(std::unique_ptr<PreparedFilter> pf);
|
std::unique_ptr<PreparedFilter> Set(std::unique_ptr<PreparedFilter> pf);
|
||||||
|
|
||||||
Filter *Get();
|
Filter *Get() noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user