QGIS API Documentation  2.11.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | List of all members
QgsExpression::Function Class Reference

A abstract base class for defining QgsExpression functions. More...

#include <qgsexpression.h>

Inheritance diagram for QgsExpression::Function:
Inheritance graph
[legend]

Public Member Functions

 Function (const QString &fnname, int params, QString group, QString helpText=QString(), bool usesGeometry=false, QStringList referencedColumns=QStringList(), bool lazyEval=false, bool handlesNull=false, bool isContextual=false)
 
virtual ~Function ()
 
virtual QStringList aliases () const
 Returns a list of possible aliases for the function. More...
 
virtual Q_DECL_DEPRECATED QVariant func (const QVariantList &, const QgsFeature *, QgsExpression *)
 
virtual QVariant func (const QVariantList &values, const QgsExpressionContext *context, QgsExpression *parent)
 Returns result of evaluating the function. More...
 
QString group ()
 The group the function belongs to. More...
 
virtual bool handlesNull () const
 
const QString helptext ()
 The help text for the function. More...
 
bool isContextual () const
 Returns whether the function is only available if provided by a QgsExpressionContext object. More...
 
bool lazyEval ()
 True if this function should use lazy evaluation. More...
 
QString name ()
 The name of the function. More...
 
bool operator== (const Function &other) const
 
int params ()
 The number of parameters this function takes. More...
 
virtual QStringList referencedColumns () const
 
bool usesgeometry ()
 Does this function use a geometry object. More...
 

Detailed Description

A abstract base class for defining QgsExpression functions.

Definition at line 337 of file qgsexpression.h.

Constructor & Destructor Documentation

QgsExpression::Function::Function ( const QString fnname,
int  params,
QString  group,
QString  helpText = QString(),
bool  usesGeometry = false,
QStringList  referencedColumns = QStringList(),
bool  lazyEval = false,
bool  handlesNull = false,
bool  isContextual = false 
)
inline

Definition at line 340 of file qgsexpression.h.

virtual QgsExpression::Function::~Function ( )
inlinevirtual

Definition at line 360 of file qgsexpression.h.

Member Function Documentation

virtual QStringList QgsExpression::Function::aliases ( ) const
inlinevirtual

Returns a list of possible aliases for the function.

These include other permissible names for the function, eg deprecated names.

Returns
list of known aliases
Note
added in QGIS 2.9

Reimplemented in QgsExpression::StaticFunction.

Definition at line 374 of file qgsexpression.h.

QVariant QgsExpression::Function::func ( const QVariantList &  values,
const QgsFeature feature,
QgsExpression parent 
)
virtual

Reimplemented in QgsExpression::StaticFunction.

Definition at line 3227 of file qgsexpression.cpp.

QVariant QgsExpression::Function::func ( const QVariantList &  values,
const QgsExpressionContext context,
QgsExpression parent 
)
virtual

Returns result of evaluating the function.

Parameters
valueslist of values passed to the function
contextcontext expression is being evaluated against
parentparent expression
Returns
result of function

Reimplemented in QgsExpression::StaticFunction, GetNamedProjectColor, and QgsScopedExpressionFunction.

Definition at line 3234 of file qgsexpression.cpp.

QString QgsExpression::Function::group ( )
inline

The group the function belongs to.

Definition at line 389 of file qgsexpression.h.

virtual bool QgsExpression::Function::handlesNull ( ) const
inlinevirtual

Definition at line 411 of file qgsexpression.h.

const QString QgsExpression::Function::helptext ( )
inline

The help text for the function.

Definition at line 391 of file qgsexpression.h.

bool QgsExpression::Function::isContextual ( ) const
inline

Returns whether the function is only available if provided by a QgsExpressionContext object.

Note
added in QGIS 2.12

Definition at line 386 of file qgsexpression.h.

bool QgsExpression::Function::lazyEval ( )
inline

True if this function should use lazy evaluation.

Lazy evaluation functions take QgsExpression::Node objects rather than the node results when called. You can use node->eval(parent, feature) to evaluate the node and return the result Functions are non lazy default and will be given the node return value when called

Definition at line 379 of file qgsexpression.h.

QString QgsExpression::Function::name ( )
inline

The name of the function.

Definition at line 363 of file qgsexpression.h.

bool QgsExpression::Function::operator== ( const Function other) const
inline

Definition at line 403 of file qgsexpression.h.

int QgsExpression::Function::params ( )
inline

The number of parameters this function takes.

Definition at line 365 of file qgsexpression.h.

virtual QStringList QgsExpression::Function::referencedColumns ( ) const
inlinevirtual

Definition at line 381 of file qgsexpression.h.

bool QgsExpression::Function::usesgeometry ( )
inline

Does this function use a geometry object.

Definition at line 367 of file qgsexpression.h.


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