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)
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.
TableExprNodeRep::NodeDataType itsDataType
PtrBlock< TableExprNodeRep * > & operands()
Get the operands.
virtual Array< String > getArrayString(const TableExprId &id)
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.
virtual Array< DComplex > getArrayDComplex(const TableExprId &id)
Bool isAggregate() const
Tell if the UDF is an aggregate function.
NodeDataType
Define the data types of a node.
virtual Array< MVTime > getArrayDate(const TableExprId &id)
const String & getUnit() const
Get the unit.
TableExprNodeRep::NodeDataType dataType() const
Get the data type.
static map< String, MakeUDFObject * > theirRegistry
void getAggrNodes(vector< TableExprNodeRep * > &aggr)
Get the nodes in the function operands representing an aggregate function.
void disableApplySelection()
Do not apply the selection.
Int ndim() const
Get the dimensionality of the results.
const IPosition & shape() const
Get the result shape if the same for all results.
PtrBlock< TableExprNodeRep * > itsOperands
std::complex< Double > DComplex
void getColumnNodes(vector< TableExprNodeRep * > &cols)
Get the nodes in the function operands representing a table column.
Bool isConstant() const
Tell if the UDF gives a constant result.
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*>.
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.
void init(const PtrBlock< TableExprNodeRep * > &arg, const Table &table, const TaQLStyle &)
Initialize the function object.
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).
virtual Array< Bool > getArrayBool(const TableExprId &id)
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)
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
virtual Array< Int64 > getArrayInt(const TableExprId &id)
void applySelection(const Vector< uInt > &rownrs)
If needed, let the UDF re-create column objects for a selection of rows.
virtual Array< Double > getArrayDouble(const TableExprId &id)