1#ifndef STORAGE_FILE_MANAGER_H
2#define STORAGE_FILE_MANAGER_H
37 bool open(
const std::filesystem::path& path)
override;
42 void close()
override;
51 std::size_t
readAt(std::uint64_t offset,
void* buffer, std::size_t
size)
override;
59 std::size_t
writeAt(std::uint64_t offset,
const void* buffer, std::size_t
size)
override;
70 std::uint64_t
size()
const override;
74 mutable std::mutex _mutex;
75 std::filesystem::path _path;
77 Xale::Logger::Logger<BinaryFileManager>& _logger;
std::uint64_t size() const override
Gets the size of the binary file.
Definition BinaryFileManager.cpp:147
void close() override
Closes the currently opened binary file.
Definition BinaryFileManager.cpp:50
BinaryFileManager(const BinaryFileManager &)=delete
std::size_t readAt(std::uint64_t offset, void *buffer, std::size_t size) override
Reads data from the binary file at the specified offset into the provided buffer.
Definition BinaryFileManager.cpp:59
BinaryFileManager & operator=(const BinaryFileManager &)=delete
bool open(const std::filesystem::path &path) override
Opens a binary file at the specified path.
Definition BinaryFileManager.cpp:17
bool sync() override
Synchronizes the binary file to ensure all data is written to disk.
Definition BinaryFileManager.cpp:133
~BinaryFileManager()
Destructor for BinaryFileManager.
Definition BinaryFileManager.cpp:9
BinaryFileManager()
Constructor for BinaryFileManager.
Definition BinaryFileManager.cpp:5
std::size_t writeAt(std::uint64_t offset, const void *buffer, std::size_t size) override
Writes data to the binary file at the specified offset from the provided buffer.
Definition BinaryFileManager.cpp:92
Interface for file management operations.
Definition IFileManager.h:13
Definition BinaryFileManager.h:13