Expression provider.
More...
#include <base/math/ExpressionParser.h>
Inherits Object.
Expression provider.
The expression provider is responsible for mapping identifiers into constants, variables, and functions.
- See also
- ExpressionParser
- Version
- 1.0
- Examples
- testsuite/eval.cpp.
◆ ExpressionProvider()
ExpressionProvider::ExpressionProvider |
( |
| ) |
|
|
noexcept |
Initializes an expression provider.
◆ ~ExpressionProvider()
ExpressionProvider::~ExpressionProvider |
( |
| ) |
|
|
noexcept |
Destroys the expression provider.
◆ getConstant()
const String& ExpressionProvider::getConstant |
( |
unsigned int |
id | ) |
const |
|
inlinenoexcept |
Returns the name of the constant with the given id.
◆ getFunction()
const String& ExpressionProvider::getFunction |
( |
unsigned int |
id | ) |
const |
|
inlinenoexcept |
Returns the name of the function with the given id.
◆ getNode()
Returns the evaluation node associated with the specified identifier. Raises InvalidKey if the identifier has not been registered.
- Parameters
-
name | The identifier to be looked up. |
◆ getVariable()
const String& ExpressionProvider::getVariable |
( |
unsigned int |
id | ) |
const |
|
inlinenoexcept |
Returns the name of the variable with the given id.
◆ isIdentifier()
bool ExpressionProvider::isIdentifier |
( |
const String & |
name | ) |
const |
|
inlinenoexcept |
Returns true if the identifier has been registered.
◆ registerConstant()
void ExpressionProvider::registerConstant |
( |
const String & |
name, |
|
|
unsigned int |
id |
|
) |
| |
Registers an identifier as a constant.
- Parameters
-
name | The identifier to be registered. |
id | The desired id of the constant. |
- Examples
- testsuite/eval.cpp.
◆ registerFunction()
void ExpressionProvider::registerFunction |
( |
const String & |
name, |
|
|
unsigned int |
id, |
|
|
unsigned int |
arguments |
|
) |
| |
Registers an identifier as a function.
- Parameters
-
name | The identifier to be registered. |
id | The desired id of the function. |
arguments | The number of arguments taken by the function. |
- Examples
- testsuite/eval.cpp.
◆ registerVariable()
void ExpressionProvider::registerVariable |
( |
const String & |
name, |
|
|
unsigned int |
id |
|
) |
| |
Registers an identifier as a variable.
- Parameters
-
name | The identifier to be registered. |
id | The desired id of the variable. |
◆ constants
◆ functions
◆ identifiers
◆ variables