![]() |
XII Release 0.1.0
|
A wrapper around xiiExpression infrastructure to evaluate simple math expressions. More...
#include <MathExpression.h>
Classes | |
struct | Input |
Public Member Functions | |
xiiMathExpression () | |
Creates a new invalid math expression. | |
xiiMathExpression (xiiStringView sExpressionString) | |
Initializes using a given expression. | |
void | Reset (xiiStringView sExpressionString) |
Reinitializes using the given expression. | |
bool | IsValid () const |
Whether the expression is valid and can be evaluated. | |
xiiStringView | GetExpressionString () const |
Returns the original expression string that this MathExpression can evaluate. | |
float | Evaluate (xiiArrayPtr< Input > inputs=xiiArrayPtr< Input >()) |
Evaluates parsed expression with the given inputs. | |
A wrapper around xiiExpression infrastructure to evaluate simple math expressions.
|
default |
Creates a new invalid math expression.
Need to call Reset before you can do anything with it.
|
explicit |
Initializes using a given expression.
If anything goes wrong it is logged and the math expression is in an invalid state.
log | If null, default log interface will be used. |
float xiiMathExpression::Evaluate | ( | xiiArrayPtr< Input > | inputs = xiiArrayPtr<Input>() | ) |
Evaluates parsed expression with the given inputs.
Only way this function can fail is if the expression was not valid.
void xiiMathExpression::Reset | ( | xiiStringView | sExpressionString | ) |
Reinitializes using the given expression.
An empty string or nullptr are considered to be 'invalid' expressions.