12#ifndef O2_FRAMEWORK_AODNATIVE_READPLAN_H_
13#define O2_FRAMEWORK_AODNATIVE_READPLAN_H_
32 std::unique_ptr<uint8_t[]>
data;
40 static constexpr size_t kMaxFree = 2;
42 std::vector<Buffer> mFree;
53 ReadPlan(std::shared_ptr<ByteSource>
source,
Options const& options, std::shared_ptr<ReadBufferPool> pool =
nullptr);
75 std::span<const uint8_t> lookup(uint64_t
offset,
size_t length)
const;
78 std::shared_ptr<ByteSource> mSource;
79 std::shared_ptr<ReadBufferPool> mPool;
81 std::vector<std::pair<uint64_t, size_t>> mPending;
82 std::vector<Chunk> mChunks;
83 std::vector<ReadBufferPool::Buffer> mBuffers;
84 mutable std::mutex mMutex;
93 uint64_t
size()
const override {
return mSource->size(); }
95 void readvInto(std::span<ReadRequest> requests)
override;
96 std::span<const uint8_t>
tryMap(uint64_t off,
size_t len)
override;
97 uint64_t
bytesRead()
const override {
return mSource->bytesRead(); }
98 uint64_t
readCalls()
const override {
return mSource->readCalls(); }
99 std::string
url()
const override {
return mSource->url(); }
102 std::shared_ptr<ByteSource> mSource;
103 std::shared_ptr<ReadPlan> mPlan;
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.
void readvInto(std::span< ReadRequest > requests) override
std::string url() const override
uint64_t readCalls() const override
uint64_t bytesRead() const override
uint64_t size() const 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.
Buffer get(size_t size)
The smallest free buffer of at least size bytes, or a new one.
ReadPlan & operator=(ReadPlan const &)=delete
ReadPlan(ReadPlan const &)=delete
void fetch()
Fetches the pending ranges now, rather than on the first find().
std::span< const uint8_t > find(uint64_t offset, size_t length)
void add(uint64_t offset, size_t length)
GLsizei GLsizei GLchar * source
GLuint GLsizei GLsizei * length
GLenum GLenum GLsizei len
std::unique_ptr< uint8_t[]> data
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))