|
VLink
2.0.0
A high-performance communication middleware
|
Opaque wrapper around exprtk::symbol_table<double>.
更多...
#include <exprtk_api.h>
Public 成员函数 | |
| ExprtkSymbolTable () | |
| Construct an empty symbol table. 更多... | |
| ~ExprtkSymbolTable () | |
| Destroy the symbol table and release the underlying ExprTk state. 更多... | |
| ExprtkSymbolTable (ExprtkSymbolTable &&) noexcept | |
| Move constructor; transfers ownership of the underlying ExprTk state. 更多... | |
| ExprtkSymbolTable & | operator= (ExprtkSymbolTable &&) noexcept |
| Move assignment; transfers ownership of the underlying ExprTk state. 更多... | |
| void | add_constants () |
Register the standard ExprTk constants (pi, epsilon, inf, ...). 更多... | |
| bool | add_variable (const std::string &name, double &value) |
| Register a named variable bound by reference. 更多... | |
友元 | |
| class | ExprtkExpression |
Opaque wrapper around exprtk::symbol_table<double>.
Holds the named constants and variables an expression may reference. Variables are registered by reference: the symbol table stores the address of the supplied double, so the referenced storage must stay alive and at a fixed address for the whole lifetime of the symbol table and any expression compiled against it.
The class is move-only; the underlying ExprTk symbol table lives on the heap behind a std::unique_ptr, so moving the wrapper never relocates it.
| vlink::ExprtkSymbolTable::ExprtkSymbolTable | ( | ) |
Construct an empty symbol table.
| vlink::ExprtkSymbolTable::~ExprtkSymbolTable | ( | ) |
Destroy the symbol table and release the underlying ExprTk state.
|
noexcept |
Move constructor; transfers ownership of the underlying ExprTk state.
| void vlink::ExprtkSymbolTable::add_constants | ( | ) |
Register the standard ExprTk constants (pi, epsilon, inf, ...).
Mirrors exprtk::symbol_table<double>::add_constants().
| bool vlink::ExprtkSymbolTable::add_variable | ( | const std::string & | name, |
| double & | value | ||
| ) |
Register a named variable bound by reference.
| name | Identifier used inside expression strings. |
| value | Reference to caller-owned storage; its address is captured, so it must outlive this table and must not be relocated after registration. |
true if the variable was added, false on a duplicate or invalid name.
|
noexcept |
Move assignment; transfers ownership of the underlying ExprTk state.
|
friend |