|
VLink
2.0.0
A high-performance communication middleware
|
Opaque wrapper around exprtk::expression<double> plus its compiler.
More...
#include <exprtk_api.h>
Public Member Functions | |
| ExprtkExpression () | |
| Construct an empty, uncompiled expression. More... | |
| ~ExprtkExpression () | |
| Destroy the expression and release the underlying ExprTk state. More... | |
| ExprtkExpression (ExprtkExpression &&) noexcept | |
| Move constructor; transfers ownership of the underlying ExprTk state. More... | |
| ExprtkExpression & | operator= (ExprtkExpression &&) noexcept |
| Move assignment; transfers ownership of the underlying ExprTk state. More... | |
| void | register_symbol_table (ExprtkSymbolTable &symbol_table) |
| Bind a symbol table to this expression. More... | |
| bool | compile (const std::string &expression) |
| Compile an expression string against the registered symbol table. More... | |
| double | value () const |
| Evaluate the compiled expression using the current variable values. More... | |
Opaque wrapper around exprtk::expression<double> plus its compiler.
Bundles a compiled expression and the one-shot parser used to build it. Register a ExprtkSymbolTable, call compile once, then call value repeatedly; the referenced symbol table must outlive the expression.
The class is move-only; the underlying ExprTk expression lives on the heap behind a std::unique_ptr, so moving the wrapper never relocates it.
| vlink::ExprtkExpression::ExprtkExpression | ( | ) |
Construct an empty, uncompiled expression.
| vlink::ExprtkExpression::~ExprtkExpression | ( | ) |
Destroy the expression and release the underlying ExprTk state.
|
noexcept |
Move constructor; transfers ownership of the underlying ExprTk state.
| bool vlink::ExprtkExpression::compile | ( | const std::string & | expression | ) |
Compile an expression string against the registered symbol table.
| expression | The ExprTk expression source to compile. |
true on success; false if the string failed to parse, in which case value must not be called.
|
noexcept |
Move assignment; transfers ownership of the underlying ExprTk state.
| void vlink::ExprtkExpression::register_symbol_table | ( | ExprtkSymbolTable & | symbol_table | ) |
Bind a symbol table to this expression.
| symbol_table | The table whose constants and variables the expression resolves against. It must outlive this expression; only its address is referenced. Call before compile. |
| double vlink::ExprtkExpression::value | ( | ) | const |
Evaluate the compiled expression using the current variable values.
true.