编译后记录流的顺序读取器 / Sequential reader for the compiled record stream
More...
#include <writer_reader.hpp>
|
| | CodeReader (const uint8_t *codes) |
| | 从单个编译字节块起点构造读取器 / Create a reader over the beginning of one compiled byte blob
|
| |
| FormatOp | ReadOp () |
| | 读取下一条运行期操作码 / Read the next runtime opcode
|
| |
| template<typename T > |
| T | Read () |
| | 读取编译期发射器按本机字节序写入的 POD 值 / Read a native-endian POD value emitted by the compile-time emitter
|
| |
| FormatType | ReadFormatType () |
| | 读取 GenericField 载荷中的语义类型字节 / Read the semantic type byte carried by one GenericField payload
|
| |
| Spec | ReadSpec () |
| | 读取紧跟在 GenericField 类型字节后的 4 字节字段载荷 / Read the 4-byte field payload that follows one GenericField type byte
|
| |
| std::string_view | ReadInlineText () |
| | 读取内嵌在记录流中的短文本 / Read a null-terminated short text payload embedded in the record stream
|
| |
| std::string_view | ReadTextRef () |
| | 读取指向尾部文本池的偏移和长度 / Read an offset-size pair pointing into the trailing text pool
|
| |
|
| const uint8_t * | pos_ = nullptr |
| |
| const uint8_t * | base_ = nullptr |
| |
编译后记录流的顺序读取器 / Sequential reader for the compiled record stream
Definition at line 10 of file writer_reader.hpp.
◆ CodeReader()
| Writer::CodeReader::CodeReader |
( |
const uint8_t * | codes | ) |
|
|
explicit |
从单个编译字节块起点构造读取器 / Create a reader over the beginning of one compiled byte blob
- Parameters
-
| codes | 指向单个编译字节块起点的指针 / Pointer to the beginning of one compiled byte blob |
◆ Read()
template<typename T >
| T Writer::CodeReader::Read |
( |
| ) |
|
|
inlinenodiscard |
读取编译期发射器按本机字节序写入的 POD 值 / Read a native-endian POD value emitted by the compile-time emitter
- Template Parameters
-
| T | 待读取的 POD 类型 / POD type to read |
- Returns
- 返回解码后的 POD 值 / Returns the decoded POD value
Definition at line 34 of file writer_reader.hpp.
35 {
36 T value{};
37 std::memcpy(&value, pos_, sizeof(T));
38 pos_ += sizeof(T);
39 return value;
40 }
◆ ReadFormatType()
| FormatType Writer::CodeReader::ReadFormatType |
( |
| ) |
|
|
nodiscard |
读取 GenericField 载荷中的语义类型字节 / Read the semantic type byte carried by one GenericField payload
- Returns
- 返回解码后的字段语义类型 / Returns the decoded field semantic type
◆ ReadInlineText()
| std::string_view Writer::CodeReader::ReadInlineText |
( |
| ) |
|
|
nodiscard |
读取内嵌在记录流中的短文本 / Read a null-terminated short text payload embedded in the record stream
- Returns
- 返回该内嵌文本片段的视图 / Returns a view of the embedded text span
◆ ReadOp()
| FormatOp Writer::CodeReader::ReadOp |
( |
| ) |
|
|
nodiscard |
读取下一条运行期操作码 / Read the next runtime opcode
- Returns
- 返回下一条解码后的运行期操作码 / Returns the next decoded runtime opcode
◆ ReadSpec()
| Spec Writer::CodeReader::ReadSpec |
( |
| ) |
|
|
nodiscard |
读取紧跟在 GenericField 类型字节后的 4 字节字段载荷 / Read the 4-byte field payload that follows one GenericField type byte
The opcode and semantic type bytes are read separately. This call only consumes flags, fill, width, and precision, in that order. 操作码与语义类型字节由外层单独读取;本函数只继续读取后续 flags、fill、width、precision 这 4 个字节,顺序固定。
- Returns
- 返回解码后的运行期字段规格 / Returns the decoded runtime field spec
◆ ReadTextRef()
| std::string_view Writer::CodeReader::ReadTextRef |
( |
| ) |
|
|
nodiscard |
读取指向尾部文本池的偏移和长度 / Read an offset-size pair pointing into the trailing text pool
The offset is already rebased against the final code blob base. 该偏移已经按最终代码块起点完成重定位。
- Returns
- 返回尾部文本池中被引用的文本片段 / Returns the referenced text span inside the trailing text pool
◆ base_
| const uint8_t* Writer::CodeReader::base_ = nullptr |
|
private |
◆ pos_
| const uint8_t* Writer::CodeReader::pos_ = nullptr |
|
private |
The documentation for this class was generated from the following file: