input/InputStream: add noexcept to ReadTag()

This commit is contained in:
Max Kellermann 2019-04-05 08:57:42 +02:00
parent 6addc9d6e0
commit 61e5828790
11 changed files with 12 additions and 16 deletions

View File

@ -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()

View File

@ -174,7 +174,7 @@ private:
*/
DecoderCommand DoSendTag(const Tag &tag);
bool UpdateStreamTag(InputStream *is);
bool UpdateStreamTag(InputStream *is) noexcept;
};
#endif

View File

@ -157,7 +157,7 @@ AsyncInputStream::SeekDone() noexcept
}
std::unique_ptr<Tag>
AsyncInputStream::ReadTag()
AsyncInputStream::ReadTag() noexcept
{
return std::exchange(tag, nullptr);
}

View File

@ -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;

View File

@ -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);
}

View File

@ -47,7 +47,7 @@ IcyInputStream::Update() noexcept
}
std::unique_ptr<Tag>
IcyInputStream::ReadTag()
IcyInputStream::ReadTag() noexcept
{
auto new_input_tag = ProxyInputStream::ReadTag();
if (!IsEnabled())

View File

@ -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;
};

View File

@ -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();

View File

@ -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

View File

@ -105,7 +105,7 @@ ProxyInputStream::IsEOF() noexcept
}
std::unique_ptr<Tag>
ProxyInputStream::ReadTag()
ProxyInputStream::ReadTag() noexcept
{
if (!input)
return nullptr;

View File

@ -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;