12#ifndef O2_FRAMEWORK_AODNATIVE_LOCALBYTESOURCE_H_
13#define O2_FRAMEWORK_AODNATIVE_LOCALBYTESOURCE_H_
28 uint64_t
size()
const override {
return mSize; }
30 void readvInto(std::span<ReadRequest> requests)
override;
31 std::span<const uint8_t>
tryMap(uint64_t off,
size_t len)
override;
32 bool canMap()
const override {
return mMap !=
nullptr; }
35 uint64_t
bytesRead()
const override {
return mBytesRead.load(std::memory_order_relaxed); }
36 uint64_t
readCalls()
const override {
return mReadCalls.load(std::memory_order_relaxed); }
37 std::string
url()
const override {
return mPath; }
40 void checkRange(uint64_t off,
size_t len)
const;
41 void advise(uint64_t off,
size_t len,
int advice);
46 uint8_t
const* mMap =
nullptr;
47 std::atomic<uint64_t> mBytesRead = 0;
48 std::atomic<uint64_t> mReadCalls = 0;
void dontNeed(uint64_t off, size_t len) override
void willNeed(uint64_t off, size_t len) override
Hints that a range will be needed soon, or is no longer needed.
void readvInto(std::span< ReadRequest > requests) override
std::string url() const override
~LocalByteSource() override
std::span< const uint8_t > tryMap(uint64_t off, size_t len) override
A view of the bytes without copying them, if the backend can provide it.
bool canMap() const override
Whether tryMap() provides every range, so that nothing needs reading.
uint64_t size() const override
void readInto(uint64_t off, size_t len, void *dst) override
Throws IoError, or CorruptData when the range is past the end of the file.
uint64_t bytesRead() const override
uint64_t readCalls() const override
GLsizei const GLchar *const * path
GLenum GLenum GLsizei len