|
libxr
Embedded C++ framework for bare-metal, RTOS and Linux
|
运行期 writer,负责打包调用点参数并执行编译好的字节流 / Runtime writer that packs call-site arguments and executes the compiled byte stream More...
#include <writer.hpp>
Classes | |
| class | ArgumentReader |
| 运行期参数字节块的顺序读取器 / Sequential reader for the packed runtime argument byte blob More... | |
| class | CodeReader |
| 编译后记录流的顺序读取器 / Sequential reader for the compiled record stream More... | |
| struct | DecimalScale |
| 科学计数法与通用浮点格式化使用的十进制规范化结果 / Decimal normalization result used by scientific and general float formatting More... | |
| class | Executor |
| 按输出端共享重后端、按调用点 profile 裁剪操作码分发的字节码执行器 / Per-sink bytecode executor with shared heavy backends and per-call profile-pruned opcode dispatch More... | |
| struct | ScientificDigits |
| 科学计数法舍入后的十进制数字块 / Rounded decimal digit block for scientific notation More... | |
Public Member Functions | |
| template<typename Float > | |
| Writer::ScientificDigits< Float > | RoundScientificDigits (Float value, uint8_t precision) |
| 把一个值归一化为科学计数法的尾数数字与十进制指数 / Normalize one value into scientific-notation mantissa digits and a decimal exponent. | |
| template<typename Float > | |
| Writer::DecimalScale< Float > | NormalizeDecimal (Float value) |
| 将一个浮点值归一化为十进制指数与缩放因子 / Normalizes one float into a decimal exponent plus scale pair. | |
Static Public Member Functions | |
| template<typename Sink , typename Format , auto ArgumentOrder, typename... Args> requires OutputSink<Sink> && CompiledFormat<std::remove_cvref_t<Format>> | |
| static ErrorCode | RunArgumentOrder (Sink &sink, const Format &, Args &&... args) |
| 执行一份编译格式;它的字段顺序与源参数顺序可以不同 / Run one compiled format whose field order and source argument order may differ | |
运行期 writer,负责打包调用点参数并执行编译好的字节流 / Runtime writer that packs call-site arguments and executes the compiled byte stream
Definition at line 120 of file writer.hpp.
| Writer::DecimalScale< Float > LibXR::Print::Writer::NormalizeDecimal | ( | Float | value | ) |
将一个浮点值归一化为十进制指数与缩放因子 / Normalizes one float into a decimal exponent plus scale pair.
| Float | 浮点类型 / Float type. |
| value | 有限正数绝对值 / Finite positive magnitude. |
Definition at line 139 of file writer.hpp.
| Writer::ScientificDigits< Float > LibXR::Print::Writer::RoundScientificDigits | ( | Float | value, |
| uint8_t | precision ) |
把一个值归一化为科学计数法的尾数数字与十进制指数 / Normalize one value into scientific-notation mantissa digits and a decimal exponent.
| Float | 浮点类型 / Float type. |
| value | 有限非负值 / Finite non-negative value. |
| precision | 尾数中保留的有效小数位数。 Significant fractional digits to retain in the mantissa. |
Definition at line 111 of file writer.hpp.
|
inlinestaticnodiscard |
执行一份编译格式;它的字段顺序与源参数顺序可以不同 / Run one compiled format whose field order and source argument order may differ
| Sink | 输出端类型,需满足 OutputSink / Sink type satisfying OutputSink |
| Format | 编译格式类型 / Compiled format type |
| ArgumentOrder | 按字段顺序排列的源参数索引表 / Source-argument index list ordered by emitted fields |
| Args | 调用点实参类型列表 / Call-site argument types |
| sink | 输出端 / Destination sink |
| format | 编译格式对象,仅用于约束与类型推导 / Compiled format object, used only for constraints and type deduction |
| args | 调用点实参 / Call-site arguments |
这条路径用于 {1} {0} 这种格式:字段仍然按源串顺序执行, 但运行期参数包要按另一种顺序构造。 This path is used by formats such as {1} {0}: fields are still executed in source order, but the runtime argument pack must be built in another order.
Definition at line 147 of file writer.hpp.