This class can be used to represent binary operation expressions. More...
#include <BinaryOperator.h>
Public Types | |
typedef void | ReturnType |
typedef Visitor | VisitorType |
Public Member Functions | |
virtual ReturnType | accept (VisitorType &guest) const =0 |
It call the visit method from the guest object. More... | |
Initializer Methods | |
Methods related to instantiation and destruction. | |
BinaryOperator (const char *opName=0) | |
It initializes a new BinaryOperator. More... | |
BinaryOperator (const char *opName, Expression *first, Expression *second) | |
It initializes a new BinaryOperator. More... | |
virtual | ~BinaryOperator () |
Virtual destructor. More... | |
Accessor methods | |
Methods used to get or set properties. | |
const char * | getName () const |
It returns the operator name. More... | |
void | setFirst (Expression *first) |
It sets the first operand. More... | |
Expression * | getFirst () const |
It returns the first operand. More... | |
void | setSecond (Expression *second) |
It sets the second operand. More... | |
Expression * | getSecond () const |
It returns the second operand. More... | |
Expression Re-implementation | |
Methods re-implemented from Expression. | |
virtual Expression * | clone () const |
It returns a clone of this object. More... | |
Private Attributes | |
Expression * | m_first |
First operand (an expression). (Mandatory) More... | |
const char * | m_opName |
The operator name. (Mandatory) More... | |
Expression * | m_second |
Second operand (an expression). (Mandatory) More... | |
This class can be used to represent binary operation expressions.
The BinaryOperator class can be used to encode the fundamental arithmetic operations of addition, subtraction, multiplication and division. Arithmetic operators are binary operators meaning that they accept two arguments and evaluate to a single result.
The following operators are defined in the Filter Encoding specification:
Of course, you can extend the list of supported binary operators.
Definition at line 66 of file BinaryOperator.h.
|
inherited |
Definition at line 58 of file BaseVisitable.h.
|
inherited |
Definition at line 57 of file BaseVisitable.h.
te::fe::BinaryOperator::BinaryOperator | ( | const char * | opName = 0 | ) |
It initializes a new BinaryOperator.
opName | The operator name. |
te::fe::BinaryOperator::BinaryOperator | ( | const char * | opName, |
Expression * | first, | ||
Expression * | second | ||
) |
It initializes a new BinaryOperator.
opName | The operator name. |
first | The first operand. |
second | The second operand. |
|
virtual |
Virtual destructor.
|
pure virtualinherited |
It call the visit method from the guest object.
guest | The guest or visitor. |
|
virtual |
Expression* te::fe::BinaryOperator::getFirst | ( | ) | const |
It returns the first operand.
|
inline |
It returns the operator name.
Definition at line 114 of file BinaryOperator.h.
Expression* te::fe::BinaryOperator::getSecond | ( | ) | const |
It returns the second operand.
void te::fe::BinaryOperator::setFirst | ( | Expression * | first | ) |
It sets the first operand.
first | The first operand. |
void te::fe::BinaryOperator::setSecond | ( | Expression * | second | ) |
It sets the second operand.
second | The second operand. |
|
private |
First operand (an expression). (Mandatory)
Definition at line 162 of file BinaryOperator.h.
|
private |
The operator name. (Mandatory)
Definition at line 161 of file BinaryOperator.h.
|
private |
Second operand (an expression). (Mandatory)
Definition at line 163 of file BinaryOperator.h.