#pragma once #ifndef _WINDOWS #include #include #include #include #include "tsl/robin_map.h" #include "utils.h" #include namespace vsag { enum class IOErrorCode; }; typedef std::function CallBack; typedef std::vector> batch_request; typedef std::function reader_function; struct AlignedRead { uint64_t offset; // where to read from uint64_t len; // how much to read void *buf; // where to read into AlignedRead() : offset(0), len(0), buf(nullptr) { } AlignedRead(uint64_t offset, uint64_t len, void *buf) : offset(offset), len(len), buf(buf) { } }; class LocalFileReader { private: reader_function func_; public: LocalFileReader(reader_function func): func_(func) {} ~LocalFileReader() = default; // de-register thread-id for a context void deregister_thread() {} void deregister_all_threads() {} // Open & close ops // Blocking calls void open(const std::string &fname) {} void close() {} // process batch of aligned requests in parallel // NOTE :: blocking call void read(std::vector &read_reqs, bool async = false, CallBack callBack = nullptr); }; #endif