Loading...
Searching...
No Matches
casacore::UDFBase Class Referenceabstract
tables package (libcasa_tables) » TaQL_module

More...

`#include <UDFBase.h>`

## Public Types

typedef UDFBase * | MakeUDFObject(const String &functionName)
| The signature of a global or static member function creating an object of the UDF.

## Public Member Functions

| UDFBase ()
| Only default constructor is needed.
virtual | ~UDFBase ()
| Destructor.
virtual Bool | getBool (const TableExprId &id)
| Evaluate the function and return the result.
virtual Int64 | getInt (const TableExprId &id)
virtual Double | getDouble (const TableExprId &id)
virtual DComplex | getDComplex (const TableExprId &id)
virtual String | getString (const TableExprId &id)
virtual TaqlRegex | getRegex (const TableExprId &id)
virtual MVTime | getDate (const TableExprId &id)
virtual MArray< Bool > | getArrayBool (const TableExprId &id)
virtual MArray< Int64 > | getArrayInt (const TableExprId &id)
virtual MArray< Double > | getArrayDouble (const TableExprId &id)
virtual MArray< DComplex > | getArrayDComplex (const TableExprId &id)
virtual MArray< String > | getArrayString (const TableExprId &id)
virtual MArray< MVTime > | getArrayDate (const TableExprId &id)
const String & | getUnit () const
| Get the unit.
const Record & | getAttributes () const
| Get the attributes.
virtual void | flattenTree (std::vector< TableExprNodeRep * > &)
| Flatten the node tree by adding the node and its children to the vector.
void | init (const std::vector< TENShPtr > &arg, const TableExprInfo &tableInfo, const TaQLStyle &)
| Initialize the function object.
TableExprNodeRep::NodeDataType | dataType () const
| Get the data type.
Int | ndim () const
| Get the dimensionality of the results.
const IPosition & | shape () const
| Get the result shape if the same for all results.
Bool | isConstant () const
| Tell if the UDF gives a constant result.
Bool | isAggregate () const
| Tell if the UDF is an aggregate function.
void | disableApplySelection ()
| Do not apply the selection.
void | applySelection (const Vector< rownr_t > &rownrs)
| If needed, let the UDF re-create column objects for a selection of rows.

## Static Public Member Functions

static void | registerUDF (const String &name, MakeUDFObject *func)
| Register the name and construction function of a UDF (thread-safe).
static UDFBase * | createUDF (const String &name, const TaQLStyle &style)
| Create a UDF object (thread-safe).

## Protected Member Functions

std::vector< TENShPtr > & | operands ()
| Get the operands.
void | setDataType (TableExprNodeRep::NodeDataType)
| Set the data type.
void | setNDim (Int ndim)
| Set the dimensionality of the results.
void | setShape (const IPosition &shape)
| Set the shape of the results if it is fixed and known.
void | setUnit (const String &unit)
| Set the unit of the result.
void | setAttributes (const Record &attributes)
| Set the attributes of the result.
void | setConstant (Bool isConstant)
| Define if the result is constant (e.g.
void | setAggregate (Bool isAggregate)
| Define if the UDF is an aggregate function (usually used in GROUPBY).
virtual void | recreateColumnObjects (const Vector< rownr_t > &rownrs)
| Let a derived class recreate its column objects in case a selection has to be applied.

## Private Member Functions

virtual void | setup (const Table &table, const TaQLStyle &)=0
| Set up the function object.

## Private Attributes

std::vector< TENShPtr > | itsOperands
TableExprNodeRep::NodeDataType | itsDataType
Int | itsNDim
IPosition | itsShape
String | itsUnit
Record | itsAttributes
Bool | itsIsConstant
Bool | itsIsAggregate
Bool | itsApplySelection

## Static Private Attributes

static map< String, MakeUDFObject * > | theirRegistry
static std::recursive_mutex | theirMutex

## Detailed Description

Abstract base class for a user-defined TaQL function

### Synopsis

This class makes it possible to add user-defined functions (UDF) to TaQL. A UDF has to be implemented in a class derived from this class and can contain one or more user-defined functions.
A few functions have to be implemented in the class as described below. In this way TaQL can be extended with arbitrary functions, which can be normal functions as well as aggregate functions (often used with GROUPBY).

A UDF is a class derived from this base class. It must contain the following member functions. See also the example below.

makeObject | a static function to create an object of the UDF class. This function needs to be registered.

setup

this virtual function is called after the object has been created. It should initialize the object using the function arguments that can be obtained using the function operands(). The setup function should perform the following:

- Define the data type of the result using setDataType<src>. The data type should be derived from the data types of the function arguments. The possible data types are defined in class TableExprNodeRep. Note that a UDF can support multiple data types. For example, a function like <src>min can be used for Int, Double, or a mix. Function 'checkDT' in class TableExprNodeMulti can be used to check the data types of the operands and determine the result data type.
- Define if the function is an aggregate function calculating an aggregated value in a group (e.g., minimum or mean). setAggregate can be used to tell so.
- Define the dimensionality of the result using setNDim. A value of 0 means a scalar. A value of -1 means an array with a dimensionality that can vary from row to row.
- Optionally use setShape to define the shape if the results are arrays with a shape that is the same for all rows. It will also set ndim if setNDim was not used yet, otherwise it checks if it ndim matches.
- Optionally set the unit of the result using setUnit. TaQL has full support of units, so UDFs should behave the same. It is possible to change the unit of the function arguments. For example:
  - a function like 'sin' can force its argument to be in radians; TaQL will scale the argument as needed. This can be done like TableExprNodeUnit::adaptUnit (operands()[i], "rad");
  - A function like 'asin' will have a result in radians. Such a UDF should set its result unit to rad.
  - A function like 'min' wants its arguments to have the same unit and will set its result unit to it. It can be done like: setUnit (TableExprFuncNode::makeEqualUnits (operands(), 0, operands().size()));
  See class TableExprFuncNode for more info about these functions.
- Optionally define attributes as a Record object. They can be used by UDFs to tell something more about the type of value.
- Optionally define if the result is a constant value using setConstant. It means that the function is not dependent on the row number in the table being queried. This is usually the case if all UDF arguments are constant.

getXXX

these are virtual get functions for each possible data type. The get functions matching the data types set by the setup function need to be implemented. The get functions have an argument TableExprId defining the table row (or record) for which the function has to be evaluated. If the UDF is an aggregate functions the TableExprId has to be upcasted to an TableExprIdAggr object from which all TableExprId objects in an aggregation group can be retrieved.
const TableExprIdAggr& aid = TableExprIdAggr::cast (id);
const vector<TableExprId>& ids = aid.result().ids(id.rownr());
casacore::TableExprGroupResult::ids
const vector< TableExprId > & ids(uInt group) const
Get the set of TableExprIds for the given group.
Definition ExprGroup.h:161
casacore::TableExprIdAggr
Definition TableExprIdAggr.h:84
casacore::TableExprIdAggr::cast
static const TableExprIdAggr & cast(const TableExprId &id)
Cast a TableExprId object to TableExprIdAggr.
Definition TableExprIdAggr.h:102
casacore::TableExprIdAggr::result
const TableExprGroupResult & result() const
Get out the aggregation result object.
Definition TableExprIdAggr.h:93

A UDF has to be made known to TaQL by adding it to the UDF registry with its name and 'makeObject' function. UDFs will usually reside in a shared library that is loaded dynamically. TaQL will load a UDF in the following way:

- The UDF name used in TaQL consists of two parts: a library name and a function name separated by a dot. Both parts need to be given. Note that the library name can also be seen as a UDF scope, so different UDFs with equal names can be used from different libraries. A UDF should be registered with this full name.
  The "USING STYLE" clause can be used to define a synonym for a (long) library name in the TaQLStyle object. The library part of the UDF will always be looked up in this synonym map.
- If a UDF is not found in the registry, it will be tried to load a shared library using the library name part. The libraries tried to be loaded are lib<library>.so and libcasa_<library>.so. On Mac.dylib will be tried. If loaded successfully, a special function 'register_libname' will be called first. It should register each UDF in the shared library using UDFBase::register.

### Example

The following examples show a normal UDF function.
It returns True if the function argument matches 1. It can be seen that it checks if the argument is an integer scalar.

class TestUDF: public UDFBase
{
public:
TestUDF() {}
// Registered function to create the UDF object.
// The name of the function is not important here.
static UDFBase* makeObject (const String&)
{ return new TestUDF(); }
// Setup and check the details; result is a bool scalar value.
virtual void setup (const Table&, const TaQLStyle&)
{
AlwaysAssert (operands().size() == 1, AipsError);
AlwaysAssert (operands()[0]->dataType() == TableExprNodeRep::NTInt,
AipsError);
AlwaysAssert (operands()[0]->valueType() == TableExprNodeRep::VTScalar,
AipsError);
setDataType (TableExprNodeRep::NTBool);
setNDim (0); // scalar result
setConstant (operands()[0].isConstant()); // constant result?
}
// Get the value for the given id.
// It gets the value of the operand and checks if it is 1.
Bool getBool (const TableExprId& id)
{ return operands()[0]->getInt(id) == 1; }
};
AlwaysAssert
#define AlwaysAssert(expr, exception)
These marcos are provided for use instead of simply using the constructors of assert_ to allow additi...
Definition Assert.h:155
casacore::String
String: the storage and methods of handling collections of characters.
Definition String.h:223
casacore::TableExprNodeRep::NTInt
@ NTInt
Definition ExprNodeRep.h:207
casacore::TableExprNodeRep::NTBool
@ NTBool
Definition ExprNodeRep.h:206
casacore::TableExprNodeRep::VTScalar
@ VTScalar
Definition ExprNodeRep.h:221
casacore::UDFBase
Definition UDFBase.h:234
casacore::UDFBase::operands
std::vector< TENShPtr > & operands()
Get the operands.
Definition UDFBase.h:282
casacore::UDFBase::setDataType
void setDataType(TableExprNodeRep::NodeDataType)
Set the data type.
casacore::UDFBase::dataType
TableExprNodeRep::NodeDataType dataType() const
Get the data type.
Definition UDFBase.h:333
casacore::UDFBase::UDFBase
UDFBase()
Only default constructor is needed.
casacore::UDFBase::getBool
virtual Bool getBool(const TableExprId &id)
Evaluate the function and return the result.
casacore::UDFBase::setConstant
void setConstant(Bool isConstant)
Define if the result is constant (e.g.
casacore::UDFBase::setNDim
void setNDim(Int ndim)
Set the dimensionality of the results.
casacore::UDFBase::isConstant
Bool isConstant() const
Tell if the UDF gives a constant result.
Definition UDFBase.h:346
casacore::UDFBase::setup
virtual void setup(const Table &table, const TaQLStyle &)=0
Set up the function object.
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
casacore::size
uInt size() const
Definition RecordInterface.h:224

### Example

The following example shows an aggregate UDF function. It calculates the sum of the cubes of the values in a group.

class TestUDFAggr: public UDFBase
{
public:
TestUDFAggr() {}
// Registered function to create the UDF object.
// The name of the function is not important here.
static UDFBase* makeObject (const String&) { return new TestUDFAggr(); }
// Setup and check the details; result is an integer scalar value.
// It aggregates the values of multiple rows.
virtual void setup (const Table&, const TaQLStyle&)
{
AlwaysAssert (operands().size() == 1, AipsError);
AlwaysAssert (operands()[0]->dataType() == TableExprNodeRep::NTInt, AipsError);
AlwaysAssert (operands()[0]->valueType() == TableExprNodeRep::VTScalar, AipsError);
setDataType (TableExprNodeRep::NTInt);
setNDim (0); // scalar
setAggregate (True); // aggregate function
}
// Get the value of a group.
// It aggregates the values of multiple rows.
Int64 getInt (const TableExprId& id)
{
// Cast the id to a TableExprIdAggr object.
const TableExprIdAggr& aid = TableExprIdAggr::cast (id);
// Get the vector of ids for this group.
const vector<TableExprId>& ids = aid.result().ids(id.rownr());
// Get the values for all ids and accumulate them.
Int64 sum3 = 0;
for (vector<TableExprId>::const_iterator it=ids.begin();
it!=ids.end(); ++it){
Int64 v = operands()[0]->getInt(*it);
sum3 += v*v*v;
}
return sum3;
}
};
casacore::UDFBase::getInt
virtual Int64 getInt(const TableExprId &id)
casacore::UDFBase::setAggregate
void setAggregate(Bool isAggregate)
Define if the UDF is an aggregate function (usually used in GROUPBY).
casacore::Int64
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size).
Definition aipsxtype.h:36
casacore::True
const Bool True
Definition aipstype.h:41

More examples of UDF functions can be found in classes UDFMSCal and DirectionUDF.

Definition at line 233 of file UDFBase.h.

## Member Typedef Documentation

## MakeUDFObject

typedef UDFBase * casacore::UDFBase::MakeUDFObject(const String &functionName)

The signature of a global or static member function creating an object of the UDF.

Definition at line 238 of file UDFBase.h.

## Constructor & Destructor Documentation

## UDFBase()

casacore::UDFBase::UDFBase | ( |  | ) |

Only default constructor is needed.

Referenced by createUDF(), casacore::UDFMSCal::makeAnt1Col(), casacore::UDFMSCal::makeAnt1Name(), casacore::UDFMSCal::makeAnt2Col(), casacore::UDFMSCal::makeAnt2Name(), casacore::DirectionUDF::makeAPP(), casacore::UDFMSCal::makeArray(), casacore::DirectionUDF::makeAZEL(), casacore::UDFMSCal::makeAZEL(), casacore::UDFMSCal::makeAZEL1(), casacore::UDFMSCal::makeAZEL2(), casacore::DirectionUDF::makeB1950(), casacore::UDFMSCal::makeBaseline(), casacore::UDFMSCal::makeCorr(), casacore::UDFMSCal::makeDelay(), casacore::UDFMSCal::makeDelay1(), casacore::UDFMSCal::makeDelay2(), casacore::DirectionUDF::makeDIR(), casacore::DirectionUDF::makeDIRCOS(), casacore::DopplerUDF::makeDOPPLER(), casacore::DirectionUDF::makeECL(), casacore::EarthMagneticUDF::makeEMANG(), casacore::EarthMagneticUDF::makeEMLEN(), casacore::EarthMagneticUDF::makeEMXYZ(), casacore::EpochUDF::makeEPOCH(), casacore::UDFMSCal::makeFeed(), casacore::UDFMSCal::makeField(), casacore::UDFMSCal::makeFieldCol(), casacore::FrequencyUDF::makeFREQ(), casacore::DirectionUDF::makeGAL(), casacore::UDFMSCal::makeHA(), casacore::UDFMSCal::makeHA1(), casacore::UDFMSCal::makeHA2(), casacore::DirectionUDF::makeHADEC(), casacore::UDFMSCal::makeHADEC(), casacore::UDFMSCal::makeHADEC1(), casacore::UDFMSCal::makeHADEC2(), casacore::HelpMeasUDF::makeHELP(), casacore::HelpMsCalUDF::makeHELP(), casacore::EarthMagneticUDF::makeIGRFANG(), casacore::EarthMagneticUDF::makeIGRFLEN(), casacore::EarthMagneticUDF::makeIGRFLONG(), casacore::EarthMagneticUDF::makeIGRFLOS(), casacore::EarthMagneticUDF::makeIGRFXYZ(), casacore::DirectionUDF::makeITRF(), casacore::UDFMSCal::makeITRF(), casacore::PositionUDF::makeITRFH(), casacore::PositionUDF::makeITRFLL(), casacore::PositionUDF::makeITRFLLH(), casacore::PositionUDF::makeITRFXYZ(), casacore::DirectionUDF::makeJ2000(), casacore::EpochUDF::makeLAST(), casacore::UDFMSCal::makeLAST(), casacore::UDFMSCal::makeLAST1(), casacore::UDFMSCal::makeLAST2(), casacore::UDFMSCal::makeObs(), casacore::UDFMSCal::makeObsCol(), casacore::UDFMSCal::makePA1(), casacore::UDFMSCal::makePA2(), casacore::UDFMSCal::makePolCol(), casacore::PositionUDF::makePOS(), casacore::UDFMSCal::makeProcCol(), casacore::RadialVelocityUDF::makeRADVEL(), casacore::FrequencyUDF::makeREST(), casacore::DirectionUDF::makeRISESET(), casacore::UDFMSCal::makeScan(), casacore::DirectionUDF::makeSGAL(), casacore::FrequencyUDF::makeSHIFT(), casacore::UDFMSCal::makeSpw(), casacore::UDFMSCal::makeSpwCol(), casacore::UDFMSCal::makeState(), casacore::UDFMSCal::makeStateCol(), casacore::UDFMSCal::makeStokes(), casacore::UDFMSCal::makeSubCol(), casacore::UDFMSCal::makeTime(), casacore::UDFMSCal::makeUVDist(), casacore::UDFMSCal::makeUvwAPP(), casacore::UDFMSCal::makeUvwJ2000(), casacore::UDFMSCal::makeUvwWvl(), casacore::UDFMSCal::makeUvwWvls(), casacore::PositionUDF::makeWGSH(), casacore::PositionUDF::makeWGSLL(), casacore::PositionUDF::makeWGSLLH(), casacore::PositionUDF::makeWGSXYZ(), casacore::UDFMSCal::makeWvlAPP(), casacore::UDFMSCal::makeWvlJ2000(), casacore::UDFMSCal::makeWvlsAPP(), and casacore::UDFMSCal::makeWvlsJ2000().

## ~UDFBase()

virtual casacore::UDFBase::~UDFBase | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## applySelection()

void casacore::UDFBase::applySelection | ( | const Vector< rownr_t > & | rownrs | ) |

If needed, let the UDF re-create column objects for a selection of rows.

It calls the function recreateColumnObjects.

## createUDF()

UDFBase * casacore::UDFBase::createUDF | ( | const String & | name,
|  | const TaQLStyle & | style )

static

Create a UDF object (thread-safe).

It looks in the map with fixed function names. If unknown, it looks if a wildcarded function name is supported (for PyTaQL).

References casacore::name(), and UDFBase().

## dataType()

TableExprNodeRep::NodeDataType casacore::UDFBase::dataType | ( |  | ) | const

inline

Get the data type.

Definition at line 333 of file UDFBase.h.

References itsDataType.

## disableApplySelection()

void casacore::UDFBase::disableApplySelection | ( |  | ) |

inline

Do not apply the selection.

Definition at line 354 of file UDFBase.h.

References casacore::False, and itsApplySelection.

## flattenTree()

virtual void casacore::UDFBase::flattenTree | ( | std::vector< TableExprNodeRep * > & |  | ) |

virtual

Flatten the node tree by adding the node and its children to the vector.

## getArrayBool()

virtual MArray< Bool > casacore::UDFBase::getArrayBool | ( | const TableExprId & | id | ) |

virtual

Reimplemented in casacore::UDFMSCal.

## getArrayDate()

virtual MArray< MVTime > casacore::UDFBase::getArrayDate | ( | const TableExprId & | id | ) |

virtual

Reimplemented in casacore::DirectionUDF.

## getArrayDComplex()

virtual MArray< DComplex > casacore::UDFBase::getArrayDComplex | ( | const TableExprId & | id | ) |

virtual

Reimplemented in casacore::UDFMSCal.

## getArrayDouble()

virtual MArray< Double > casacore::UDFBase::getArrayDouble | ( | const TableExprId & | id | ) |

virtual

Reimplemented in casacore::DirectionUDF, casacore::DopplerUDF, casacore::EarthMagneticUDF, casacore::EpochUDF, casacore::FrequencyUDF, casacore::PositionUDF, casacore::RadialVelocityUDF, and casacore::UDFMSCal.

## getArrayInt()

virtual MArray< Int64 > casacore::UDFBase::getArrayInt | ( | const TableExprId & | id | ) |

virtual

Reimplemented in casacore::UDFMSCal.

## getArrayString()

virtual MArray< String > casacore::UDFBase::getArrayString | ( | const TableExprId & | id | ) |

virtual

Reimplemented in casacore::UDFMSCal.

## getAttributes()

const Record & casacore::UDFBase::getAttributes | ( |  | ) | const

inline

Get the attributes.

Definition at line 269 of file UDFBase.h.

References itsAttributes, and casacore::Record().

## getBool()

virtual Bool casacore::UDFBase::getBool | ( | const TableExprId & | id | ) |

virtual

Evaluate the function and return the result.

Their default implementations throw a "not implemented" exception.

Reimplemented in casacore::UDFMSCal.

## getDate()

virtual MVTime casacore::UDFBase::getDate | ( | const TableExprId & | id | ) |

virtual

## getDComplex()

virtual DComplex casacore::UDFBase::getDComplex | ( | const TableExprId & | id | ) |

virtual

Reimplemented in casacore::UDFMSCal.

## getDouble()

virtual Double casacore::UDFBase::getDouble | ( | const TableExprId & | id | ) |

virtual

Reimplemented in casacore::DirectionUDF, casacore::DopplerUDF, casacore::EarthMagneticUDF, casacore::EpochUDF, casacore::FrequencyUDF, casacore::PositionUDF, casacore::RadialVelocityUDF, and casacore::UDFMSCal.

## getInt()

virtual Int64 casacore::UDFBase::getInt | ( | const TableExprId & | id | ) |

virtual

Reimplemented in casacore::UDFMSCal.

## getRegex()

virtual TaqlRegex casacore::UDFBase::getRegex | ( | const TableExprId & | id | ) |

virtual

## getString()

virtual String casacore::UDFBase::getString | ( | const TableExprId & | id | ) |

virtual

Reimplemented in casacore::HelpMeasUDF, casacore::HelpMsCalUDF, and casacore::UDFMSCal.

## getUnit()

const String & casacore::UDFBase::getUnit | ( |  | ) | const

inline

Get the unit.

Definition at line 265 of file UDFBase.h.

References itsUnit.

## init()

void casacore::UDFBase::init | ( | const std::vector< TENShPtr > & | arg,
|  | const TableExprInfo & | tableInfo,
|  | const TaQLStyle & | )

Initialize the function object.

References casacore::arg().

## isAggregate()

Bool casacore::UDFBase::isAggregate | ( |  | ) | const

inline

Tell if the UDF is an aggregate function.

Definition at line 350 of file UDFBase.h.

References itsIsAggregate.

Referenced by setAggregate().

## isConstant()

Bool casacore::UDFBase::isConstant | ( |  | ) | const

inline

Tell if the UDF gives a constant result.

Definition at line 346 of file UDFBase.h.

References itsIsConstant.

Referenced by setConstant().

## ndim()

Int casacore::UDFBase::ndim | ( |  | ) | const

inline

Get the dimensionality of the results.

(0=scalar, -1=array with variable ndim, >0=array with fixed ndim

Definition at line 338 of file UDFBase.h.

References itsNDim.

Referenced by setNDim().

## operands()

std::vector< TENShPtr > & casacore::UDFBase::operands | ( |  | ) |

inline protected

Get the operands.

Definition at line 282 of file UDFBase.h.

References itsOperands.

Referenced by casacore::UDFMSCal::setupGetValue(), casacore::UDFMSCal::setupSelection(), casacore::UDFMSCal::setupStokes(), and casacore::UDFMSCal::setupWvls().

## recreateColumnObjects()

virtual void casacore::UDFBase::recreateColumnObjects | ( | const Vector< rownr_t > & | rownrs | ) |

protected virtual

Let a derived class recreate its column objects in case a selection has to be applied.

The default implementation does nothing.

Reimplemented in casacore::UDFMSCal.

## registerUDF()

void casacore::UDFBase::registerUDF | ( | const String & | name,
|  | MakeUDFObject * | func )

static

Register the name and construction function of a UDF (thread-safe).

An exception is thrown if this name already exists with a different construction function.

References casacore::name().

## setAggregate()

void casacore::UDFBase::setAggregate | ( | Bool | isAggregate | ) |

protected

Define if the UDF is an aggregate function (usually used in GROUPBY).

References isAggregate().

## setAttributes()

void casacore::UDFBase::setAttributes | ( | const Record & | attributes | ) |

protected

Set the attributes of the result.

If this function is not called by the setup function of the derived class, the result has no attributes.

References casacore::Record().

## setConstant()

void casacore::UDFBase::setConstant | ( | Bool | isConstant | ) |

protected

Define if the result is constant (e.g.

if all arguments are constant). If this function is not called by the setup function of the derived class, the result is not constant.

References isConstant().

## setDataType()

void casacore::UDFBase::setDataType | ( | TableExprNodeRep::NodeDataType |  | ) |

protected

Set the data type.

This function must be called by the setup function of the derived class.

## setNDim()

void casacore::UDFBase::setNDim | ( | Int | ndim | ) |

protected

Set the dimensionality of the results.

0 means that the results are scalars.
-1 means that the results are arrays with unknown dimensionality.
>0 means that the results are arrays with that dimensionality. This function must be called by the setup function of the derived class.

References ndim().

## setShape()

void casacore::UDFBase::setShape | ( | const IPosition & | shape | ) |

protected

Set the shape of the results if it is fixed and known.

References shape().

## setUnit()

void casacore::UDFBase::setUnit | ( | const String & | unit | ) |

protected

Set the unit of the result.

If this function is not called by the setup function of the derived class, the result has no unit.

## setup()

virtual void casacore::UDFBase::setup | ( | const Table & | table,
|  | const TaQLStyle & | )

private pure virtual

Set up the function object.

Implemented in casacore::DirectionUDF, casacore::DopplerUDF, casacore::EarthMagneticUDF, casacore::EpochUDF, casacore::FrequencyUDF, casacore::HelpMeasUDF, casacore::HelpMsCalUDF, casacore::PositionUDF, casacore::RadialVelocityUDF, and casacore::UDFMSCal.

## shape()

const IPosition & casacore::UDFBase::shape | ( |  | ) | const

inline

Get the result shape if the same for all results.

Definition at line 342 of file UDFBase.h.

References itsShape.

Referenced by setShape().

## Member Data Documentation

## itsApplySelection

Bool casacore::UDFBase::itsApplySelection

private

Definition at line 376 of file UDFBase.h.

Referenced by disableApplySelection().

## itsAttributes

Record casacore::UDFBase::itsAttributes

private

Definition at line 373 of file UDFBase.h.

Referenced by getAttributes().

## itsDataType

TableExprNodeRep::NodeDataType casacore::UDFBase::itsDataType

private

Definition at line 369 of file UDFBase.h.

Referenced by dataType().

## itsIsAggregate

Bool casacore::UDFBase::itsIsAggregate

private

Definition at line 375 of file UDFBase.h.

Referenced by isAggregate().

## itsIsConstant

Bool casacore::UDFBase::itsIsConstant

private

Definition at line 374 of file UDFBase.h.

Referenced by isConstant().

## itsNDim

Int casacore::UDFBase::itsNDim

private

Definition at line 370 of file UDFBase.h.

Referenced by ndim().

## itsOperands

std::vector<TENShPtr> casacore::UDFBase::itsOperands

private

Definition at line 368 of file UDFBase.h.

Referenced by operands().

## itsShape

IPosition casacore::UDFBase::itsShape

private

Definition at line 371 of file UDFBase.h.

Referenced by shape().

## itsUnit

String casacore::UDFBase::itsUnit

private

Definition at line 372 of file UDFBase.h.

Referenced by getUnit().

## theirMutex

std::recursive_mutex casacore::UDFBase::theirMutex

static private

Definition at line 383 of file UDFBase.h.

## theirRegistry

map<String, MakeUDFObject*> casacore::UDFBase::theirRegistry

static private

Definition at line 382 of file UDFBase.h.

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

- tables/TaQL/UDFBase.h