Skip to content
Permalink
Browse files

Doxymentation for QgsExpression::Node

  • Loading branch information
m-kuhn committed Aug 16, 2015
1 parent f8dd490 commit bbce092e5b16afbf925272bd11e46e9c354036a0
Showing with 53 additions and 5 deletions.
  1. +53 −5 src/core/qgsexpression.h
@@ -436,21 +436,69 @@ class CORE_EXPORT QgsExpression
{
public:
virtual ~Node() {}

/**
* Abstract virtual that returns the type of this node.
*
* @return The type of this node
*/
virtual NodeType nodeType() const = 0;
// abstract virtual eval function
// errors are reported to the parent
/**
* Abstract virtual eval method
* Errors are reported to the parent
*/
virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) = 0;

// abstract virtual preparation function
// errors are reported to the parent
/**
* Abstract virtual preparation method
* Errors are reported to the parent
*/
virtual bool prepare( QgsExpression* parent, const QgsFields &fields ) = 0;

/**
* Abstract virtual dump method
*
* @return An expression which represents this node as string
*/
virtual QString dump() const = 0;

/**
* Abstract virtual method which returns a list of columns required to
* evaluate this node.
*
* When reimplementing this, you need to return any column that is required to
* evaluate this node and in addition recursively collect all the columns required
* to evaluate child nodes.
*
* @return A list of columns required to evaluate this expression
*/
virtual QStringList referencedColumns() const = 0;

/**
* Abstract virtual method which returns if the geometry is required to evaluate
* this expression.
*
* This needs to call `needsGeometry()` recursively on any child nodes.
*
* @return true if a geometry is required to evaluate this expression
*/
virtual bool needsGeometry() const = 0;

// support for visitor pattern
/**
* Support the visitor pattern.
*
* For any implementation this should look like
*
* C++:
*
* v.visit( *this );
*
* Python:
*
* v.visit( self)
*
* @param v A visitor that visits this node.
*/
virtual void accept( Visitor& v ) const = 0;
};

0 comments on commit bbce092

Please sign in to comment.
You can’t perform that action at this time.