Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement user_datasource_wrapper is_empty() and is_device_read_preferred(). #14357

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cpp/src/io/utilities/datasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@ class user_datasource_wrapper : public datasource {
return source->supports_device_read();
}

[[nodiscard]] bool is_device_read_preferred(size_t size) const override
{
return source->is_device_read_preferred(size);
}

size_t device_read(size_t offset,
size_t size,
uint8_t* dst,
Expand All @@ -385,6 +390,8 @@ class user_datasource_wrapper : public datasource {

[[nodiscard]] size_t size() const override { return source->size(); }

[[nodiscard]] bool is_empty() const override { return source->is_empty(); }

private:
datasource* const source; ///< A non-owning pointer to the user-implemented datasource
};
Expand Down