An expression evaluator. More...
#include "murl_util_evaluator.h"
Public Member Functions | |
Evaluator () | |
The constructor. | |
virtual | ~Evaluator () |
The destructor. | |
virtual Bool | AddConstants (const IAttributes *constants) |
Add a set of user-defined constants used during evaluation. More... | |
virtual Bool | AddVariables (IAttributes *variables) |
Add a set of user-defined variables used during evaluation. More... | |
virtual Bool | Update () |
Update the evaluator. More... | |
virtual Bool | Evaluate (const String &expression, String &result) |
Evaluate a given expression string. More... | |
virtual UInt32 | GetNumberOfConstantSets () const |
Get the number of known constant sets. More... | |
virtual UInt32 | GetNumberOfConstants (UInt32 constantSetIndex) const |
Get the number of known constants for a given set. More... | |
virtual String | GetConstantName (UInt32 constantSetIndex, UInt32 constantIndex) const |
Get the name of a given constant. More... | |
virtual String | GetConstantValue (UInt32 constantSetIndex, UInt32 constantIndex) const |
Get the value of a given constant. More... | |
virtual UInt32 | GetNumberOfVariableSets () const |
Get the number of known variable sets. More... | |
virtual UInt32 | GetNumberOfVariables (UInt32 variableSetIndex) const |
Get the number of known variables for a given set. More... | |
virtual String | GetVariableName (UInt32 variableSetIndex, UInt32 variableIndex) const |
Get the name of a given variable. More... | |
virtual String | GetVariableValue (UInt32 variableSetIndex, UInt32 variableIndex) const |
Get the value of a given variable. More... | |
virtual UInt32 | GetNumberOfFunctionSets () const |
Get the number of known function sets. More... | |
virtual UInt32 | GetNumberOfFunctions (UInt32 functionSetIndex) const |
Get the number of known functions for a given set. More... | |
virtual String | GetFunctionName (UInt32 functionSetIndex, UInt32 functionIndex) const |
Get the name of a given function. More... | |
virtual SInt32 | GetFunctionMinNumberOfArguments (UInt32 functionSetIndex, UInt32 functionIndex) const |
Get the minimum number of arguments for a given function. More... | |
virtual SInt32 | GetFunctionMaxNumberOfArguments (UInt32 functionSetIndex, UInt32 functionIndex) const |
Get the maximum number of arguments for a given function. More... | |
virtual String | GetFunctionArgumentName (UInt32 functionSetIndex, UInt32 functionIndex, UInt32 argumentIndex) const |
Get the name of a given function's argument. More... | |
Detailed Description
An expression evaluator.
Member Function Documentation
◆ AddConstants()
|
virtual |
Add a set of user-defined constants used during evaluation.
- Parameters
-
constants The user-defined constants.
- Returns
- true if successful.
◆ AddVariables()
|
virtual |
Add a set of user-defined variables used during evaluation.
- Parameters
-
variables The user-defined variables.
- Returns
- true if successful.
◆ Update()
|
virtual |
Update the evaluator.
Whenever an input constant or variable has changed, this method must be called prior to Evaluate() to reflect the actual changes.
- Returns
- true if successful.
◆ Evaluate()
Evaluate a given expression string.
- Parameters
-
expression The expression string to evaluate result A reference to a string receiving the result.
- Returns
- true if successful.
◆ GetNumberOfConstantSets()
|
virtual |
Get the number of known constant sets.
- Returns
- The number of constant sets.
◆ GetNumberOfConstants()
Get the number of known constants for a given set.
- Parameters
-
constantSetIndex The index of the constant set.
- Returns
- The number of constant sets.
◆ GetConstantName()
|
virtual |
Get the name of a given constant.
- Parameters
-
constantSetIndex The index of the constant set. constantIndex The index of the constant.
- Returns
- The name of the constant.
◆ GetConstantValue()
|
virtual |
Get the value of a given constant.
- Parameters
-
constantSetIndex The index of the constant set. constantIndex The index of the constant.
- Returns
- The value of the constant.
◆ GetNumberOfVariableSets()
|
virtual |
Get the number of known variable sets.
- Returns
- The number of variable sets.
◆ GetNumberOfVariables()
Get the number of known variables for a given set.
- Parameters
-
variableSetIndex The index of the variable set.
- Returns
- The number of variables.
◆ GetVariableName()
|
virtual |
Get the name of a given variable.
- Parameters
-
variableSetIndex The index of the variable set. variableIndex The index of the variable.
- Returns
- The name of the variable.
◆ GetVariableValue()
|
virtual |
Get the value of a given variable.
- Parameters
-
variableSetIndex The index of the variable set. variableIndex The index of the variable.
- Returns
- The value of the variable.
◆ GetNumberOfFunctionSets()
|
virtual |
Get the number of known function sets.
- Returns
- The number of function sets.
◆ GetNumberOfFunctions()
Get the number of known functions for a given set.
- Parameters
-
functionSetIndex The index of the function set.
- Returns
- The number of functions.
◆ GetFunctionName()
|
virtual |
Get the name of a given function.
- Parameters
-
functionSetIndex The index of the function set. functionIndex The index of the function.
- Returns
- The name of the function.
◆ GetFunctionMinNumberOfArguments()
|
virtual |
Get the minimum number of arguments for a given function.
- Parameters
-
functionSetIndex The index of the function set. functionIndex The index of the function.
- Returns
- The minimum argument count.
◆ GetFunctionMaxNumberOfArguments()
|
virtual |
Get the maximum number of arguments for a given function.
- Parameters
-
functionSetIndex The index of the function set. functionIndex The index of the function.
- Returns
- The maximum argument count.
◆ GetFunctionArgumentName()
|
virtual |
Get the name of a given function's argument.
- Parameters
-
functionSetIndex The index of the function set. functionIndex The index of the function. argumentIndex The index of the argument.
- Returns
- The name of the argument.
The documentation for this class was generated from the following file:
- murl_util_evaluator.h