Flash 存储的块信息结构 (Structure representing a Flash storage block).
More...
|
|
union { | |
| |
| uint32_t header | |
| | Flash 块头签名 / Flash block-header signature. More...
|
| |
| uint8_t padding [MinWriteSize] | |
| | 按最小写入单元对齐的原始块前缀 / Raw block prefix aligned to one minimum write unit. More...
|
| |
| }; | | |
| | 让块前缀既能按签名读取,也能按最小写入单元整体写入 / Expose the block prefix both as a signature field and as one full minimum-write-unit write span
|
| |
| KeyInfo | key |
| | 紧跟在块头后的首个键头 / First key header stored right after the block header.
|
| |
template<size_t MinWriteSize>
struct LibXR::DatabaseRaw< MinWriteSize >::FlashInfo
Flash 存储的块信息结构 (Structure representing a Flash storage block).
Definition at line 163 of file raw.hpp.
◆ FlashInfo()
template<size_t MinWriteSize>
构造一个擦除态 FlashInfo 缓冲对象 (Construct one erased-state FlashInfo buffer object).
Definition at line 169 of file raw.hpp.
178{
179
203template <size_t MinWriteSize>
205{
215 static constexpr uint32_t FLASH_HEADER =
216 0x12345678 + LIBXR_DATABASE_VERSION;
217
226 static constexpr uint32_t CHECKSUM_BYTE = 0x9abcedf0;
227
228
229
230
231#include "layout.hpp"
232
237 size_t recycle_threshold_ = 0;
238
243 Flash& flash_;
244
249 uint32_t block_size_;
250
259 uint8_t write_buffer_[MinWriteSize];
260
261
262
263
264#include "flash_io.hpp"
265
266
267
268
269#include "block_ops.hpp"
270
271
272
273
274#include "key_ops.hpp"
275
280 public:
281
282
283
284#include "lifecycle.hpp"
285};
286
287}
DatabaseRaw(Flash &flash, size_t recycle_threshold=128)
构造函数,初始化 Flash 存储和缓冲区 (Constructor to initialize Flash storage and buffer).
◆ header
template<size_t MinWriteSize>
◆ key
template<size_t MinWriteSize>
紧跟在块头后的首个键头 / First key header stored right after the block header.
Definition at line 185 of file raw.hpp.
◆ padding
template<size_t MinWriteSize>
按最小写入单元对齐的原始块前缀 / Raw block prefix aligned to one minimum write unit.
Definition at line 183 of file raw.hpp.
The documentation for this struct was generated from the following file:
- src/middleware/database/raw/raw.hpp