Lightweight formula evaluation engine.
More...
#include <XLFormulaEngine.hpp>
|
| | XLFormulaArg ()=default |
| | XLFormulaArg (XLCellValue v) |
| | XLFormulaArg (std::vector< XLCellValue > arr) |
| | Construct a column vector (N×1) from a flat list.
|
| | XLFormulaArg (std::vector< XLCellValue > data, size_t rows, size_t cols) |
| | Construct a dense row-major 2-D array.
|
| | XLFormulaArg (uint32_t r1, uint32_t r2, uint16_t c1, uint16_t c2, std::string sheetName, const std::function< XLCellValue(std::string_view)> *resolver) |
| Type | type () const |
| size_t | rows () const |
| size_t | cols () const |
| uint32_t | firstRow () const noexcept |
| | Return the 1-based row of the top-left cell (LazyRange only; 0 for other types).
|
| uint16_t | firstCol () const noexcept |
| | Return the 1-based column of the top-left cell (LazyRange only; 0 for other types).
|
| uint32_t | lastRow () const noexcept |
| | Bottom-right row for LazyRange (0 otherwise).
|
| uint16_t | lastCol () const noexcept |
| | Bottom-right column for LazyRange (0 otherwise).
|
| const std::string & | sheetName () const noexcept |
| bool | empty () const |
| size_t | size () const |
| XLCellValue | at (size_t row, size_t col) const |
| | 0-based (row, col) access. Works for Scalar, Array, and LazyRange.
|
| XLCellValue | operator[] (size_t index) const |
| XLFormulaArg | materialize () const |
| | Materialize any arg into a dense row-major Array (copy).
|
| XLCellValue | asScalar () const |
| | Implicit-intersection / top-left scalar projection.
|
| Iterator | begin () const |
| Iterator | end () const |
Lightweight formula evaluation engine.
Usage:
Class encapsulating a cell value.
Definition XLCellValue.hpp:89
Evaluation context backed by a live worksheet (and its workbook for sheet-qualified refs).
Definition XLEvaluationContext.hpp:75
The engine is thread-safe for concurrent evaluate() calls after construction (the function table is built once in the constructor and is read-only thereafter). Cell lookup goes through XLEvaluationContext / XLCellResolver so formula code never depends on concrete worksheet internals.
◆ Type
| Enumerator |
|---|
| Empty | |
| Scalar | |
| Array | |
| LazyRange | |
◆ XLFormulaArg() [1/5]
| OpenXLSX::XLFormulaArg::XLFormulaArg |
( |
| ) |
|
|
default |
◆ XLFormulaArg() [2/5]
◆ XLFormulaArg() [3/5]
| OpenXLSX::XLFormulaArg::XLFormulaArg |
( |
std::vector< XLCellValue > | arr | ) |
|
|
inline |
Construct a column vector (N×1) from a flat list.
Preserves historical 1-D behaviour used by arithmetic broadcast helpers.
◆ XLFormulaArg() [4/5]
| OpenXLSX::XLFormulaArg::XLFormulaArg |
( |
std::vector< XLCellValue > | data, |
|
|
size_t | rows, |
|
|
size_t | cols ) |
|
inline |
Construct a dense row-major 2-D array.
- Parameters
-
| data | Must contain rows*cols elements (row-major). |
◆ XLFormulaArg() [5/5]
| OpenXLSX::XLFormulaArg::XLFormulaArg |
( |
uint32_t | r1, |
|
|
uint32_t | r2, |
|
|
uint16_t | c1, |
|
|
uint16_t | c2, |
|
|
std::string | sheetName, |
|
|
const std::function< XLCellValue(std::string_view)> * | resolver ) |
|
inline |
◆ asScalar()
Implicit-intersection / top-left scalar projection.
◆ at()
| XLCellValue OpenXLSX::XLFormulaArg::at |
( |
size_t | row, |
|
|
size_t | col ) const |
|
inlinenodiscard |
0-based (row, col) access. Works for Scalar, Array, and LazyRange.
◆ begin()
| Iterator OpenXLSX::XLFormulaArg::begin |
( |
| ) |
const |
|
inline |
◆ cols()
| size_t OpenXLSX::XLFormulaArg::cols |
( |
| ) |
const |
|
inline |
◆ empty()
| bool OpenXLSX::XLFormulaArg::empty |
( |
| ) |
const |
|
inline |
◆ end()
| Iterator OpenXLSX::XLFormulaArg::end |
( |
| ) |
const |
|
inline |
◆ firstCol()
| uint16_t OpenXLSX::XLFormulaArg::firstCol |
( |
| ) |
const |
|
inlinenoexcept |
Return the 1-based column of the top-left cell (LazyRange only; 0 for other types).
◆ firstRow()
| uint32_t OpenXLSX::XLFormulaArg::firstRow |
( |
| ) |
const |
|
inlinenoexcept |
Return the 1-based row of the top-left cell (LazyRange only; 0 for other types).
◆ lastCol()
| uint16_t OpenXLSX::XLFormulaArg::lastCol |
( |
| ) |
const |
|
inlinenoexcept |
Bottom-right column for LazyRange (0 otherwise).
◆ lastRow()
| uint32_t OpenXLSX::XLFormulaArg::lastRow |
( |
| ) |
const |
|
inlinenoexcept |
Bottom-right row for LazyRange (0 otherwise).
◆ materialize()
Materialize any arg into a dense row-major Array (copy).
Scalars become 1×1; LazyRange is fully resolved via the cell resolver.
◆ operator[]()
| XLCellValue OpenXLSX::XLFormulaArg::operator[] |
( |
size_t | index | ) |
const |
|
inline |
◆ rows()
| size_t OpenXLSX::XLFormulaArg::rows |
( |
| ) |
const |
|
inline |
◆ sheetName()
| const std::string & OpenXLSX::XLFormulaArg::sheetName |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ size()
| size_t OpenXLSX::XLFormulaArg::size |
( |
| ) |
const |
|
inline |
◆ type()
| Type OpenXLSX::XLFormulaArg::type |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: