28 #ifndef TABLES_UDFBASE_H 29 #define TABLES_UDFBASE_H 32 #include <casacore/casa/aips.h> 33 #include <casacore/tables/TaQL/ExprNodeRep.h> 34 #include <casacore/tables/Tables/Table.h> 35 #include <casacore/tables/TaQL/TaQLStyle.h> 36 #include <casacore/casa/Containers/Block.h> 37 #include <casacore/casa/OS/Mutex.h> 38 #include <casacore/casa/stdmap.h> A Vector of integers, for indexing into Array<T> objects.
void setUnit(const String &unit)
Set the unit of the result.
virtual MVTime getDate(const TableExprId &id)
virtual MArray< Bool > getArrayBool(const TableExprId &id)
Int ndim() const
Get the dimensionality of the results.
const String & getUnit() const
Get the unit.
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
LatticeExprNode arg(const LatticeExprNode &expr)
void setNDim(Int ndim)
Set the dimensionality of the results.
Main interface class to a read/write table.
virtual MArray< Double > getArrayDouble(const TableExprId &id)
TableExprNodeRep::NodeDataType itsDataType
PtrBlock< TableExprNodeRep * > & operands()
Get the operands.
TableExprNodeRep::NodeDataType dataType() const
Get the data type.
UDFBase()
Only default constructor is needed.
void setAggregate(Bool isAggregate)
Define if the UDF is an aggregate function (usually used in GROUPBY).
virtual Bool getBool(const TableExprId &id)
Evaluate the function and return the result.
Abstract base class for a user-defined TaQL function.
NodeDataType
Define the data types of a node.
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
virtual MArray< MVTime > getArrayDate(const TableExprId &id)
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
static map< String, MakeUDFObject * > theirRegistry
void disableApplySelection()
Do not apply the selection.
void getColumnNodes(vector< TableExprNodeRep *> &cols)
Get the nodes in the function operands representing a table column.
void getAggrNodes(vector< TableExprNodeRep *> &aggr)
Get the nodes in the function operands representing an aggregate function.
PtrBlock< TableExprNodeRep * > itsOperands
std::complex< Double > DComplex
Class with static members defining the TaQL style.
void setConstant(Bool isConstant)
Define if the result is constant (e.g.
virtual ~UDFBase()
Destructor.
bool Bool
Define the standard types used by Casacore.
UDFBase * MakeUDFObject(const String &functionName)
The signature of a global or static member function creating an object of the UDF.
virtual void recreateColumnObjects(const Vector< uInt > &rownrs)
Let a derived class recreate its column objects in case a selection has to be applied.
virtual Int64 getInt(const TableExprId &id)
A drop-in replacement for Block<T*>.
void init(const PtrBlock< TableExprNodeRep *> &arg, const Table &table, const TaQLStyle &)
Initialize the function object.
virtual MArray< String > getArrayString(const TableExprId &id)
Wrapper around a pthreads mutex.
void setDataType(TableExprNodeRep::NodeDataType)
Set the data type.
void setShape(const IPosition &shape)
Set the shape of the results if it is fixed and known.
The identification of a TaQL selection subject.
Class to handle a Regex or StringDistance.
String: the storage and methods of handling collections of characters.
static void registerUDF(const String &name, MakeUDFObject *func)
Register the name and construction function of a UDF (thread-safe).
Bool isConstant() const
Tell if the UDF gives a constant result.
virtual DComplex getDComplex(const TableExprId &id)
virtual String getString(const TableExprId &id)
Class to handle date/time type conversions and I/O.
static UDFBase * createUDF(const String &name, const TaQLStyle &style)
Create a UDF object (thread-safe).
virtual Double getDouble(const TableExprId &id)
Bool isAggregate() const
Tell if the UDF is an aggregate function.
const IPosition & shape() const
Get the result shape if the same for all results.
virtual TaqlRegex getRegex(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
void applySelection(const Vector< uInt > &rownrs)
If needed, let the UDF re-create column objects for a selection of rows.