Kun Yi | 91beea6 | 2018-11-26 15:23:14 -0800 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include <blobs-ipmid/blobs.hpp> |
| 4 | #include <cstdint> |
| 5 | #include <string> |
| 6 | #include <vector> |
| 7 | |
| 8 | using std::size_t; |
| 9 | using std::uint16_t; |
| 10 | using std::uint32_t; |
| 11 | using std::uint64_t; |
| 12 | using std::uint8_t; |
| 13 | |
| 14 | namespace blobs |
| 15 | { |
| 16 | |
| 17 | class BinaryStoreBlobHandler : public GenericBlobInterface |
| 18 | { |
| 19 | public: |
| 20 | BinaryStoreBlobHandler() = default; |
| 21 | ~BinaryStoreBlobHandler() = default; |
| 22 | BinaryStoreBlobHandler(const BinaryStoreBlobHandler&) = delete; |
| 23 | BinaryStoreBlobHandler& operator=(const BinaryStoreBlobHandler&) = delete; |
| 24 | BinaryStoreBlobHandler(BinaryStoreBlobHandler&&) = default; |
| 25 | BinaryStoreBlobHandler& operator=(BinaryStoreBlobHandler&&) = default; |
| 26 | |
| 27 | bool canHandleBlob(const std::string& path) override; |
| 28 | std::vector<std::string> getBlobIds() override; |
| 29 | bool deleteBlob(const std::string& path) override; |
| 30 | bool stat(const std::string& path, struct BlobMeta* meta) override; |
| 31 | bool open(uint16_t session, uint16_t flags, |
| 32 | const std::string& path) override; |
| 33 | std::vector<uint8_t> read(uint16_t session, uint32_t offset, |
| 34 | uint32_t requestedSize) override; |
| 35 | bool write(uint16_t session, uint32_t offset, |
| 36 | const std::vector<uint8_t>& data) override; |
| 37 | bool writeMeta(uint16_t session, uint32_t offset, |
| 38 | const std::vector<uint8_t>& data) override; |
| 39 | bool commit(uint16_t session, const std::vector<uint8_t>& data) override; |
| 40 | bool close(uint16_t session) override; |
| 41 | bool stat(uint16_t session, struct BlobMeta* meta) override; |
| 42 | bool expire(uint16_t session) override; |
| 43 | }; |
| 44 | |
| 45 | } // namespace blobs |