Navigation
API > API/Plugins > API/Plugins/OptimusCore
Simple, fast expression evaluation engine. Can evaluate simple arithmetic expressions, including user-settable constants. 1 + 1 foo + (3.0 * bar)
Allowable operands are taken from Python and are currently as follow: -x Unary negation x + y Addition x - y Subtraction x * y Multiplication x / y Division (div-by-zero returns zero) x ** y Raise x to y's power x // y Division and rounding down.
Terms can also be grouped by parentheses '(' and ')'.
Constants that begin with a number, include spaces or any of the above operands/parentheses are allowed, but must be then enclosed in single quotes when referenced. E.g: 'foo(1)' * 2.0 rather than: foo (1) * 2.0
| Name | FEngine |
| Type | class |
| Header File | /Engine/Plugins/Animation/DeformerGraph/Source/OptimusCore/Public/OptimusExpressionEvaluator.h |
| Include Path | #include "OptimusExpressionEvaluator.h" |
Syntax
class FEngine
Structs
| Name | Remarks |
|---|---|
| FFunctionInfo | |
| FTokenParseResult |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FToken | TVariant< EOperatorToken, FName, float > | OptimusExpressionEvaluator.h | |
| FunctionType | TFunction< float(TArrayView< const float >)> | OptimusExpressionEvaluator.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TOptional< float > Evaluate
(
FStringView InExpression, |
Evaluate an expression directly and returns the result. | OptimusExpressionEvaluator.h | |
float Execute
(
const FExpressionObject& InExpressionObject, |
Executes the given expression object. | OptimusExpressionEvaluator.h | |
| Parse an expression and either receive an error or a expression execution object that matches this evaluator. | OptimusExpressionEvaluator.h | ||
| Verify an expression. | OptimusExpressionEvaluator.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FTokenParseResult ParseFloat
(
FStringView& InOutParseRange, |
Parse a floating point value and return the result (or error). | OptimusExpressionEvaluator.h | |
static FTokenParseResult ParseIdentifier
(
FStringView& InOutParseRange, |
Parse a constant reference and return the result (or error). | OptimusExpressionEvaluator.h | |
static FTokenParseResult ParseToken
(
FStringView& InOutParseRange, |
Parse a single token from the beginning of the range, returning either the token or an error, if one was encountered. | OptimusExpressionEvaluator.h | |
| Helper function to get a text version of a token. | OptimusExpressionEvaluator.h |