@@ -436,21 +436,69 @@ class CORE_EXPORT QgsExpression
436436 {
437437 public:
438438 virtual ~Node () {}
439+
440+ /* *
441+ * Abstract virtual that returns the type of this node.
442+ *
443+ * @return The type of this node
444+ */
439445 virtual NodeType nodeType () const = 0;
440- // abstract virtual eval function
441- // errors are reported to the parent
446+ /* *
447+ * Abstract virtual eval method
448+ * Errors are reported to the parent
449+ */
442450 virtual QVariant eval ( QgsExpression* parent, const QgsFeature* f ) = 0;
443451
444- // abstract virtual preparation function
445- // errors are reported to the parent
452+ /* *
453+ * Abstract virtual preparation method
454+ * Errors are reported to the parent
455+ */
446456 virtual bool prepare ( QgsExpression* parent, const QgsFields &fields ) = 0;
447457
458+ /* *
459+ * Abstract virtual dump method
460+ *
461+ * @return An expression which represents this node as string
462+ */
448463 virtual QString dump () const = 0;
449464
465+ /* *
466+ * Abstract virtual method which returns a list of columns required to
467+ * evaluate this node.
468+ *
469+ * When reimplementing this, you need to return any column that is required to
470+ * evaluate this node and in addition recursively collect all the columns required
471+ * to evaluate child nodes.
472+ *
473+ * @return A list of columns required to evaluate this expression
474+ */
450475 virtual QStringList referencedColumns () const = 0;
476+
477+ /* *
478+ * Abstract virtual method which returns if the geometry is required to evaluate
479+ * this expression.
480+ *
481+ * This needs to call `needsGeometry()` recursively on any child nodes.
482+ *
483+ * @return true if a geometry is required to evaluate this expression
484+ */
451485 virtual bool needsGeometry () const = 0;
452486
453- // support for visitor pattern
487+ /* *
488+ * Support the visitor pattern.
489+ *
490+ * For any implementation this should look like
491+ *
492+ * C++:
493+ *
494+ * v.visit( *this );
495+ *
496+ * Python:
497+ *
498+ * v.visit( self)
499+ *
500+ * @param v A visitor that visits this node.
501+ */
454502 virtual void accept ( Visitor& v ) const = 0;
455503 };
456504
0 commit comments