Public Member Functions | |
| Expression () | |
| Builds an empty expression. More... | |
| Expression (const Expression &expr) | |
| Copies an expression. More... | |
| Expression (Expression &&expr) | |
| Moves an expression. More... | |
| Expression (const char *expr) | |
| Builds (i.e. More... | |
| Expression (const std::string &expr) | |
| Builds (i.e. More... | |
| Expression (long expr) | |
| Builds an expression that represents an integer. More... | |
| Expression (double expr) | |
| Builds an expression that represents a float. More... | |
| Expression (PC_tree_t expr) | |
| Builds an expression that is parsed from PC_tree_t. More... | |
| ~Expression () | |
| Destroys an expression. More... | |
| Expression & | operator= (const Expression &expr) |
| Copies an expression. More... | |
| Expression & | operator= (Expression &&expr) |
| Moves an expression. More... | |
| Expression | operator+ (const Expression &expr) const |
| Summation operator of an expression. More... | |
| Expression | operator* (const Expression &expr) const |
| Multiplication operator of an expression. More... | |
| Expression | operator- (const Expression &expr) const |
| Subtraction operator of an expression. More... | |
| Expression | operator/ (const Expression &expr) const |
| Division operator of an expression. More... | |
| Expression | operator% (const Expression &expr) const |
| Modulo operator of an expression. More... | |
| operator bool () const | |
| Checks whether this is an empty expression. More... | |
| long | to_long (Context &ctx) const |
| Evaluates an expression as an integer. More... | |
| double | to_double (Context &ctx) const |
| Evaluates an expression as a float. More... | |
| std::string | to_string (Context &ctx) const |
| Evaluates an expression as a string. More... | |
| Ref | to_ref (Context &ctx) const |
| Evaluates an expression as a data reference. More... | |
| Ref | to_ref (Context &ctx, Datatype_sptr type) const |
| Evaluates an expression as a data reference. More... | |
Static Public Member Functions | |
| static std::pair< Expression, long > | parse_reference (const char *reference_str) |
Parses a string that starts with $ and represents a reference expression. More... | |
| PDI::Expression::Expression | ( | ) |
Builds an empty expression.
No operation can be used on an empty expression, it can only be assigned to
| PDI::Expression::Expression | ( | const Expression & | expr | ) |
Copies an expression.
| [in] | expr | the expression to copy |
| PDI::Expression::Expression | ( | Expression && | expr | ) |
Moves an expression.
| [in] | expr | the expression to move |
| PDI::Expression::Expression | ( | const char * | expr | ) |
Builds (i.e.
parse) an expression from a string
The grammar of an expression is as follow:
| [in] | expr | the string to parse |
| PDI::Expression::Expression | ( | const std::string & | expr | ) |
Builds (i.e.
parse) an expression from a string
The grammar of an expression is as follow:
| [in] | expr | the string to parse |
| PDI::Expression::Expression | ( | long | expr | ) |
Builds an expression that represents an integer.
| [in] | expr | the integer value |
| PDI::Expression::Expression | ( | double | expr | ) |
Builds an expression that represents a float.
| [in] | expr | the flaot value |
| PDI::Expression::Expression | ( | PC_tree_t | expr | ) |
Builds an expression that is parsed from PC_tree_t.
| [in] | expr | the PC_tree_t value |
| PDI::Expression::~Expression | ( | ) |
Destroys an expression.
| Expression & PDI::Expression::operator= | ( | const Expression & | expr | ) |
Copies an expression.
| [in] | expr | the expression to copy |
| Expression & PDI::Expression::operator= | ( | Expression && | expr | ) |
Moves an expression.
| [in] | expr | the expression to move` |
| Expression PDI::Expression::operator+ | ( | const Expression & | expr | ) | const |
Summation operator of an expression.
| [in] | expr | the expression to add |
| Expression PDI::Expression::operator* | ( | const Expression & | expr | ) | const |
Multiplication operator of an expression.
| [in] | expr | the expression to multiply |
| Expression PDI::Expression::operator- | ( | const Expression & | expr | ) | const |
Subtraction operator of an expression.
| [in] | expr | the expression to subtract |
| Expression PDI::Expression::operator/ | ( | const Expression & | expr | ) | const |
Division operator of an expression.
| [in] | expr | the expression to divide |
| Expression PDI::Expression::operator% | ( | const Expression & | expr | ) | const |
Modulo operator of an expression.
| [in] | expr | the expression to use modulo |
| PDI::Expression::operator bool | ( | ) | const |
Checks whether this is an empty expression.
| long PDI::Expression::to_long | ( | Context & | ctx | ) | const |
Evaluates an expression as an integer.
| double PDI::Expression::to_double | ( | Context & | ctx | ) | const |
Evaluates an expression as a float.
| std::string PDI::Expression::to_string | ( | Context & | ctx | ) | const |
Evaluates an expression as a string.
Evaluates an expression as a data reference.
| ctx | the context in which to evaluate the expression |
| Ref PDI::Expression::to_ref | ( | Context & | ctx, |
| Datatype_sptr | type | ||
| ) | const |
Evaluates an expression as a data reference.
| ctx | the context in which to evaluate the expression |
| type | the type of the created Ref |
|
static |
Parses a string that starts with $ and represents a reference expression.
| [in] | reference_str | string that represents a reference expression |