![]() |
Plasma Engine
2.0
|
A wrapper around plExpression infrastructure to evaluate simple math expressions. More...
#include <MathExpression.h>
Classes | |
| struct | Input |
Public Member Functions | |
| plMathExpression () | |
| Creates a new invalid math expression. | |
| plMathExpression (plStringView sExpressionString) | |
| Initializes using a given expression. | |
| void | Reset (plStringView sExpressionString) |
| Reinitializes using the given expression. | |
| bool | IsValid () const |
| Whether the expression is valid and can be evaluated. | |
| plStringView | GetExpressionString () const |
| Returns the original expression string that this MathExpression can evaluate. | |
| float | Evaluate (plArrayPtr< Input > inputs=plArrayPtr< Input >()) |
| Evaluates parsed expression with the given inputs. | |
A wrapper around plExpression 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 plMathExpression::Evaluate | ( | plArrayPtr< Input > | inputs = plArrayPtr<Input>() | ) |
Evaluates parsed expression with the given inputs.
Only way this function can fail is if the expression was not valid.
| void plMathExpression::Reset | ( | plStringView | sExpressionString | ) |
Reinitializes using the given expression.
An empty string or nullptr are considered to be 'invalid' expressions.