26#ifndef TABLES_UDFBASE_H
27#define TABLES_UDFBASE_H
30#include <casacore/casa/aips.h>
31#include <casacore/tables/TaQL/ExprNodeRep.h>
32#include <casacore/tables/Tables/Table.h>
33#include <casacore/tables/TaQL/TaQLStyle.h>
34#include <casacore/casa/Containers/Record.h>
35#include <casacore/casa/Containers/Block.h>
36#include <casacore/casa/stdmap.h>
329 void init (
const std::vector<TENShPtr>& arg,
String: the storage and methods of handling collections of characters.
Class to connect a Table and its alias name.
NodeDataType
Define the data types of a node.
virtual MArray< MVTime > getArrayDate(const TableExprId &id)
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
virtual Double getDouble(const TableExprId &id)
const Record & getAttributes() const
Get the attributes.
const String & getUnit() const
Get the unit.
TableExprNodeRep::NodeDataType itsDataType
void setAttributes(const Record &attributes)
Set the attributes of the result.
void init(const std::vector< TENShPtr > &arg, const TableExprInfo &tableInfo, const TaQLStyle &)
Initialize the function object.
std::vector< TENShPtr > & operands()
Get the operands.
void setDataType(TableExprNodeRep::NodeDataType)
Set the data type.
virtual Int64 getInt(const TableExprId &id)
TableExprNodeRep::NodeDataType dataType() const
Get the data type.
virtual MVTime getDate(const TableExprId &id)
virtual TaqlRegex getRegex(const TableExprId &id)
UDFBase * MakeUDFObject(const String &functionName)
The signature of a global or static member function creating an object of the UDF.
void applySelection(const Vector< rownr_t > &rownrs)
If needed, let the UDF re-create column objects for a selection of rows.
Int ndim() const
Get the dimensionality of the results.
void setAggregate(Bool isAggregate)
Define if the UDF is an aggregate function (usually used in GROUPBY).
Bool isAggregate() const
Tell if the UDF is an aggregate function.
void setUnit(const String &unit)
Set the unit of the result.
virtual void recreateColumnObjects(const Vector< rownr_t > &rownrs)
Let a derived class recreate its column objects in case a selection has to be applied.
std::vector< TENShPtr > itsOperands
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
UDFBase()
Only default constructor is needed.
static UDFBase * createUDF(const String &name, const TaQLStyle &style)
Create a UDF object (thread-safe).
virtual Bool getBool(const TableExprId &id)
Evaluate the function and return the result.
virtual DComplex getDComplex(const TableExprId &id)
void setConstant(Bool isConstant)
Define if the result is constant (e.g.
const IPosition & shape() const
Get the result shape if the same for all results.
void setNDim(Int ndim)
Set the dimensionality of the results.
virtual void flattenTree(std::vector< TableExprNodeRep * > &)
Flatten the node tree by adding the node and its children to the vector.
static std::recursive_mutex theirMutex
virtual MArray< Double > getArrayDouble(const TableExprId &id)
virtual ~UDFBase()
Destructor.
static map< String, MakeUDFObject * > theirRegistry
Bool isConstant() const
Tell if the UDF gives a constant result.
void disableApplySelection()
Do not apply the selection.
virtual String getString(const TableExprId &id)
static void registerUDF(const String &name, MakeUDFObject *func)
Register the name and construction function of a UDF (thread-safe).
virtual MArray< String > getArrayString(const TableExprId &id)
void setShape(const IPosition &shape)
Set the shape of the results if it is fixed and known.
virtual MArray< Bool > getArrayBool(const TableExprId &id)
virtual void setup(const Table &table, const TaQLStyle &)=0
Set up the function object.
this file contains all the compiler specific defines
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
bool Bool
Define the standard types used by Casacore.