键信息结构,存储键的元数据 (Structure containing key metadata).
More...
|
| | KeyInfo () |
| | 构造一个默认可写的键头元数据 (Construct one default writable key-header metadata object).
|
| |
| void | SetNameLength (uint8_t len) |
| | 设置键名长度 (Set the key name length).
|
| |
| uint8_t | GetNameLength () const |
| | 获取键名长度 (Get the key name length).
|
| |
| void | SetDataSize (uint32_t size) |
| | 设置数据字节数 (Set the payload size in bytes).
|
| |
| uint32_t | GetDataSize () const |
| | 获取数据字节数 (Get the payload size in bytes).
|
| |
template<size_t MinWriteSize>
struct LibXR::DatabaseRaw< MinWriteSize >::KeyInfo
键信息结构,存储键的元数据 (Structure containing key metadata).
Definition at line 106 of file raw.hpp.
◆ KeyInfo()
template<size_t MinWriteSize>
构造一个默认可写的键头元数据 (Construct one default writable key-header metadata object).
Definition at line 120 of file raw.hpp.
129{
130
154template <size_t MinWriteSize>
156{
166 static constexpr uint32_t FLASH_HEADER = 0x12345678 + LIBXR_DATABASE_VERSION;
167
176 static constexpr uint32_t CHECKSUM_BYTE = 0x9abcedf0;
177
178
179
180
181#include "layout.hpp"
182
187 size_t recycle_threshold_ = 0;
188
193 Flash& flash_;
194
199 uint32_t block_size_;
200
209 uint8_t write_buffer_[MinWriteSize];
210
211
212
213
214#include "flash_io.hpp"
215
216
217
218
219#include "block_ops.hpp"
220
221
222
223
224#include "key_ops.hpp"
225
230 public:
231
232
233
234#include "lifecycle.hpp"
235};
236
237}
DatabaseRaw(Flash &flash, size_t recycle_threshold=128)
构造函数,初始化 Flash 存储和缓冲区 (Constructor to initialize Flash storage and buffer).
◆ GetDataSize()
template<size_t MinWriteSize>
获取数据字节数 (Get the payload size in bytes).
- Returns
- 数据字节数 (Payload size in bytes).
Definition at line 155 of file raw.hpp.
164{
165
189template <size_t MinWriteSize>
191{
201 static constexpr uint32_t FLASH_HEADER = 0x12345678 + LIBXR_DATABASE_VERSION;
202
211 static constexpr uint32_t CHECKSUM_BYTE = 0x9abcedf0;
212
213
214
215
216#include "layout.hpp"
217
222 size_t recycle_threshold_ = 0;
223
228 Flash& flash_;
229
234 uint32_t block_size_;
235
244 uint8_t write_buffer_[MinWriteSize];
245
246
247
248
249#include "flash_io.hpp"
250
251
252
253
254#include "block_ops.hpp"
255
256
257
258
259#include "key_ops.hpp"
260
265 public:
266
267
268
269#include "lifecycle.hpp"
270};
271
272}
◆ GetNameLength()
template<size_t MinWriteSize>
获取键名长度 (Get the key name length).
- Returns
- 键名长度 (Key name length).
Definition at line 140 of file raw.hpp.
149{
150
174template <size_t MinWriteSize>
176{
186 static constexpr uint32_t FLASH_HEADER = 0x12345678 + LIBXR_DATABASE_VERSION;
187
196 static constexpr uint32_t CHECKSUM_BYTE = 0x9abcedf0;
197
198
199
200
201#include "layout.hpp"
202
207 size_t recycle_threshold_ = 0;
208
213 Flash& flash_;
214
219 uint32_t block_size_;
220
229 uint8_t write_buffer_[MinWriteSize];
230
231
232
233
234#include "flash_io.hpp"
235
236
237
238
239#include "block_ops.hpp"
240
241
242
243
244#include "key_ops.hpp"
245
250 public:
251
252
253
254#include "lifecycle.hpp"
255};
256
257}
◆ SetDataSize()
template<size_t MinWriteSize>
设置数据字节数 (Set the payload size in bytes).
- Parameters
-
| size | 数据字节数 (Payload size in bytes). |
Definition at line 146 of file raw.hpp.
155{
156
180template <size_t MinWriteSize>
182{
192 static constexpr uint32_t FLASH_HEADER = 0x12345678 + LIBXR_DATABASE_VERSION;
193
202 static constexpr uint32_t CHECKSUM_BYTE = 0x9abcedf0;
203
204
205
206
207#include "layout.hpp"
208
213 size_t recycle_threshold_ = 0;
214
219 Flash& flash_;
220
225 uint32_t block_size_;
226
235 uint8_t write_buffer_[MinWriteSize];
236
237
238
239
240#include "flash_io.hpp"
241
242
243
244
245#include "block_ops.hpp"
246
247
248
249
250#include "key_ops.hpp"
251
256 public:
257
258
259
260#include "lifecycle.hpp"
261};
262
263}
◆ SetNameLength()
template<size_t MinWriteSize>
设置键名长度 (Set the key name length).
- Parameters
-
| len | 键名长度 (Key name length). |
Definition at line 131 of file raw.hpp.
140{
141
165template <size_t MinWriteSize>
167{
177 static constexpr uint32_t FLASH_HEADER = 0x12345678 + LIBXR_DATABASE_VERSION;
178
187 static constexpr uint32_t CHECKSUM_BYTE = 0x9abcedf0;
188
189
190
191
192#include "layout.hpp"
193
198 size_t recycle_threshold_ = 0;
199
204 Flash& flash_;
205
210 uint32_t block_size_;
211
220 uint8_t write_buffer_[MinWriteSize];
221
222
223
224
225#include "flash_io.hpp"
226
227
228
229
230#include "block_ops.hpp"
231
232
233
234
235#include "key_ops.hpp"
236
241 public:
242
243
244
245#include "lifecycle.hpp"
246};
247
248}
◆ available_flag
template<size_t MinWriteSize>
◆ no_next_key
template<size_t MinWriteSize>
◆ raw_info
template<size_t MinWriteSize>
Initial value:高 7 位保存 nameLength,低 25 位保存 dataSize。 Upper 7 bits store nameLength and lower 25 bits store dataSize.
Definition at line 112 of file raw.hpp.
◆ uninit
template<size_t MinWriteSize>
The documentation for this struct was generated from the following file:
- src/middleware/database/raw/raw.hpp