QGIS API Documentation 4.3.0-Master (bd2f5e21fd1)
Loading...
Searching...
No Matches
QgsEsriArcadeBinaryOperatorExpression Class Reference

Represents a binary operation expression. More...

#include <qgsesriarcadescript.h>

Inheritance diagram for QgsEsriArcadeBinaryOperatorExpression:

Public Types

enum class  BinaryOperator {
  Plus , Minus , Multiply , Divide ,
  Modulo , Equal , NotEqual , LessThan ,
  GreaterThan , LessThanOrEqual , GreaterThanOrEqual , LogicalAnd ,
  LogicalOr , BitwiseAnd , BitwiseOr , BitwiseXor ,
  BitwiseLeftShift , BitwiseSignedRightShift , BitwiseUnsignedRightShift
}
 Binary operator enumeration. More...
Public Types inherited from QgsEsriArcadeNode
enum class  NodeType {
  BlockStatement , VariableDeclarationStatement , ReturnStatement , AssignmentStatement ,
  FunctionDeclarationStatement , ExpressionStatement , LiteralExpression , VariableReferenceExpression ,
  ProfileVariableReferenceExpression , MemberAccessExpression , BinaryOperatorExpression , UnaryOperatorExpression ,
  FunctionCallExpression , IndexExpression , ArrayLiteralExpression , DictionaryLiteralExpression ,
  IfStatement , ForStatement , ForInStatement , WhileStatement ,
  BreakStatement , ContinueStatement
}
 Node type identifier. More...

Public Member Functions

 QgsEsriArcadeBinaryOperatorExpression (BinaryOperator binaryOperator, QgsEsriArcadeExpression *leftOperand, QgsEsriArcadeExpression *rightOperand)
 Constructor for QgsEsriArcadeBinaryOperatorExpression.
void accept (QgsEsriArcadeVisitor &visitor) const override
 Accepts a visitor to traverse the node.
BinaryOperator binaryOperator () const
 Returns the binary operator.
QgsEsriArcadeNode * clone () const override
 Creates a copy of the node.
QString dump () const override
 Returns the formatted script representation of the node.
bool leftAssociative () const
 Returns true if operator is left-associative.
QgsEsriArcadeExpression * leftOperand () const
 Returns the left-hand operand expression.
QgsEsriArcadeNode::NodeType nodeType () const override
 Returns the node type.
int precedence () const
 Returns operator precedence value.
QgsEsriArcadeExpression * rightOperand () const
 Returns the right-hand operand expression.
QString text () const
 Returns text representation of the operator.
Public Member Functions inherited from QgsEsriArcadeExpression
 ~QgsEsriArcadeExpression () override=default
Public Member Functions inherited from QgsEsriArcadeNode
virtual ~QgsEsriArcadeNode ()=default

Static Public Attributes

static const char * BINARY_OPERATOR_TEXT [] = { "+", "-", "*", "/", "%", "==", "!=", "<", ">", "<=", ">=", "&&", "||", "&", "|", "^", "<<", ">>", ">>>" }

Detailed Description

Represents a binary operation expression.

Since
QGIS 4.4

Definition at line 686 of file qgsesriarcadescript.h.

Member Enumeration Documentation

◆ BinaryOperator

Binary operator enumeration.

Enumerator
Plus 

Addition +.

Minus 

Subtraction -.

Multiply 

Multiplication *.

Divide 

Division /.

Modulo 

Modulo %.

Equal 

Equality test ==.

NotEqual 

Not equal test !=.

LessThan 

Less than <.

GreaterThan 

Greater than >.

LessThanOrEqual 

Less than or equal to <=.

GreaterThanOrEqual 

Greater than or equal to >=.

LogicalAnd 

Logical and &&.

LogicalOr 

Logical or ||.

BitwiseAnd 

Bitwise and, eg "7 & 14".

BitwiseOr 

Bitwise or, eg "7 | 14".

BitwiseXor 

Bitwise xor, eg "7 ^ 14".

BitwiseLeftShift 

Bitwise left shift, eg "7 << 14".

BitwiseSignedRightShift 

Bitwise right shift, eg "7 >> 14".

BitwiseUnsignedRightShift 

Bitwise unsigned right shift, eg "7 >>> 14".

Definition at line 692 of file qgsesriarcadescript.h.

Constructor & Destructor Documentation

◆ QgsEsriArcadeBinaryOperatorExpression()

QgsEsriArcadeBinaryOperatorExpression::QgsEsriArcadeBinaryOperatorExpression ( BinaryOperator binaryOperator,
QgsEsriArcadeExpression * leftOperand,
QgsEsriArcadeExpression * rightOperand )

Constructor for QgsEsriArcadeBinaryOperatorExpression.

Ownership of leftOperand and rightOperand is transferred to this expression.

Definition at line 351 of file qgsesriarcadescript.cpp.

Member Function Documentation

◆ accept()

void QgsEsriArcadeBinaryOperatorExpression::accept ( QgsEsriArcadeVisitor & visitor) const
overridevirtual

Accepts a visitor to traverse the node.

Implements QgsEsriArcadeNode.

Definition at line 423 of file qgsesriarcadescript.cpp.

◆ binaryOperator()

BinaryOperator QgsEsriArcadeBinaryOperatorExpression::binaryOperator ( ) const
inline

Returns the binary operator.

Definition at line 733 of file qgsesriarcadescript.h.

◆ clone()

QgsEsriArcadeNode * QgsEsriArcadeBinaryOperatorExpression::clone ( ) const
overridevirtual

Creates a copy of the node.

Caller takes ownership of the returned object.

Implements QgsEsriArcadeNode.

Definition at line 416 of file qgsesriarcadescript.cpp.

◆ dump()

QString QgsEsriArcadeBinaryOperatorExpression::dump ( ) const
overridevirtual

Returns the formatted script representation of the node.

This can be used to export a script node back to a valid Esri arcade script string.

Implements QgsEsriArcadeNode.

Definition at line 404 of file qgsesriarcadescript.cpp.

◆ leftAssociative()

bool QgsEsriArcadeBinaryOperatorExpression::leftAssociative ( ) const

Returns true if operator is left-associative.

Definition at line 399 of file qgsesriarcadescript.cpp.

◆ leftOperand()

QgsEsriArcadeExpression * QgsEsriArcadeBinaryOperatorExpression::leftOperand ( ) const
inline

Returns the left-hand operand expression.

Definition at line 738 of file qgsesriarcadescript.h.

◆ nodeType()

QgsEsriArcadeNode::NodeType QgsEsriArcadeBinaryOperatorExpression::nodeType ( ) const
inlineoverridevirtual

Returns the node type.

Implements QgsEsriArcadeNode.

Definition at line 725 of file qgsesriarcadescript.h.

◆ precedence()

int QgsEsriArcadeBinaryOperatorExpression::precedence ( ) const

Returns operator precedence value.

Definition at line 362 of file qgsesriarcadescript.cpp.

◆ rightOperand()

QgsEsriArcadeExpression * QgsEsriArcadeBinaryOperatorExpression::rightOperand ( ) const
inline

Returns the right-hand operand expression.

Definition at line 743 of file qgsesriarcadescript.h.

◆ text()

QString QgsEsriArcadeBinaryOperatorExpression::text ( ) const

Returns text representation of the operator.

Definition at line 357 of file qgsesriarcadescript.cpp.

Member Data Documentation

◆ BINARY_OPERATOR_TEXT

const char * QgsEsriArcadeBinaryOperatorExpression::BINARY_OPERATOR_TEXT = { "+", "-", "*", "/", "%", "==", "!=", "<", ">", "<=", ">=", "&&", "||", "&", "|", "^", "<<", ">>", ">>>" }
static
Note
not available in Python bindings

Definition at line 31 of file qgsesriarcadescript.h.


The documentation for this class was generated from the following files: