input/InputStream: add noexcept
to ReadTag()
This commit is contained in:
parent
6addc9d6e0
commit
61e5828790
@ -214,7 +214,7 @@ DecoderBridge::DoSendTag(const Tag &tag)
|
||||
}
|
||||
|
||||
bool
|
||||
DecoderBridge::UpdateStreamTag(InputStream *is)
|
||||
DecoderBridge::UpdateStreamTag(InputStream *is) noexcept
|
||||
{
|
||||
auto tag = is != nullptr
|
||||
? is->LockReadTag()
|
||||
|
@ -174,7 +174,7 @@ private:
|
||||
*/
|
||||
DecoderCommand DoSendTag(const Tag &tag);
|
||||
|
||||
bool UpdateStreamTag(InputStream *is);
|
||||
bool UpdateStreamTag(InputStream *is) noexcept;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -157,7 +157,7 @@ AsyncInputStream::SeekDone() noexcept
|
||||
}
|
||||
|
||||
std::unique_ptr<Tag>
|
||||
AsyncInputStream::ReadTag()
|
||||
AsyncInputStream::ReadTag() noexcept
|
||||
{
|
||||
return std::exchange(tag, nullptr);
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
void Check() final;
|
||||
bool IsEOF() noexcept final;
|
||||
void Seek(offset_type new_offset) final;
|
||||
std::unique_ptr<Tag> ReadTag() final;
|
||||
std::unique_ptr<Tag> ReadTag() noexcept final;
|
||||
bool IsAvailable() noexcept final;
|
||||
size_t Read(void *ptr, size_t read_size) final;
|
||||
|
||||
|
@ -53,10 +53,6 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
std::unique_ptr<Tag> ReadTag() override {
|
||||
std::rethrow_exception(error);
|
||||
}
|
||||
|
||||
size_t Read(void *, size_t) override {
|
||||
std::rethrow_exception(error);
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ IcyInputStream::Update() noexcept
|
||||
}
|
||||
|
||||
std::unique_ptr<Tag>
|
||||
IcyInputStream::ReadTag()
|
||||
IcyInputStream::ReadTag() noexcept
|
||||
{
|
||||
auto new_input_tag = ProxyInputStream::ReadTag();
|
||||
if (!IsEnabled())
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
|
||||
/* virtual methods from InputStream */
|
||||
void Update() noexcept override;
|
||||
std::unique_ptr<Tag> ReadTag() override;
|
||||
std::unique_ptr<Tag> ReadTag() noexcept override;
|
||||
size_t Read(void *ptr, size_t size) override;
|
||||
};
|
||||
|
||||
|
@ -92,13 +92,13 @@ InputStream::LockSkip(offset_type _offset)
|
||||
}
|
||||
|
||||
std::unique_ptr<Tag>
|
||||
InputStream::ReadTag()
|
||||
InputStream::ReadTag() noexcept
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<Tag>
|
||||
InputStream::LockReadTag()
|
||||
InputStream::LockReadTag() noexcept
|
||||
{
|
||||
const std::lock_guard<Mutex> protect(mutex);
|
||||
return ReadTag();
|
||||
|
@ -325,13 +325,13 @@ public:
|
||||
* @return a tag object or nullptr if the tag has not changed
|
||||
* since the last call
|
||||
*/
|
||||
virtual std::unique_ptr<Tag> ReadTag();
|
||||
virtual std::unique_ptr<Tag> ReadTag() noexcept;
|
||||
|
||||
/**
|
||||
* Wrapper for ReadTag() which locks and unlocks the mutex;
|
||||
* the caller must not be holding it already.
|
||||
*/
|
||||
std::unique_ptr<Tag> LockReadTag();
|
||||
std::unique_ptr<Tag> LockReadTag() noexcept;
|
||||
|
||||
/**
|
||||
* Returns true if the next read operation will not block: either data
|
||||
|
@ -105,7 +105,7 @@ ProxyInputStream::IsEOF() noexcept
|
||||
}
|
||||
|
||||
std::unique_ptr<Tag>
|
||||
ProxyInputStream::ReadTag()
|
||||
ProxyInputStream::ReadTag() noexcept
|
||||
{
|
||||
if (!input)
|
||||
return nullptr;
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
void Update() noexcept override;
|
||||
void Seek(offset_type new_offset) override;
|
||||
bool IsEOF() noexcept override;
|
||||
std::unique_ptr<Tag> ReadTag() override;
|
||||
std::unique_ptr<Tag> ReadTag() noexcept override;
|
||||
bool IsAvailable() noexcept override;
|
||||
size_t Read(void *ptr, size_t read_size) override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user