VirtualTaQLColumn.h

Classes

VirtualTaQLColumn -- Virtual scalar column using TaQL (full description)

class VirtualTaQLColumn : public VirtualColumnEngine, public DataManagerColumn

Interface

Public Members
VirtualTaQLColumn (const String& expr)
VirtualTaQLColumn (const Record& spec)
virtual ~VirtualTaQLColumn()
virtual DataManager* clone() const
virtual Record dataManagerSpec() const
virtual String dataManagerType() const
static void registerClass()
const String& expression() const
virtual int dataType() const
virtual Bool isWritable() const
virtual uInt ndim (uInt rownr)
virtual IPosition shape (uInt rownr)
virtual Bool isShapeDefined (uInt rownr)
Private Members
VirtualTaQLColumn (const VirtualTaQLColumn&)
VirtualTaQLColumn& operator= (const VirtualTaQLColumn&)
virtual DataManagerColumn* makeScalarColumn (const String& columnName, int dataType, const String&)
virtual DataManagerColumn* makeIndArrColumn (const String& columnName, int dataType, const String& dataTypeId)
virtual void create (uInt)
virtual void prepare()
static DataManager* makeObject (const String& dataManagerName, const Record& spec)
virtual void getBoolV (uInt rownr, Bool* dataPtr)
virtual void getuCharV (uInt rownr, uChar* dataPtr)
virtual void getShortV (uInt rownr, Short* dataPtr)
virtual void getuShortV (uInt rownr, uShort* dataPtr)
virtual void getIntV (uInt rownr, Int* dataPtr)
virtual void getuIntV (uInt rownr, uInt* dataPtr)
virtual void getfloatV (uInt rownr, float* dataPtr)
virtual void getdoubleV (uInt rownr, double* dataPtr)
virtual void getComplexV (uInt rownr, Complex* dataPtr)
virtual void getDComplexV (uInt rownr, DComplex* dataPtr)
virtual void getStringV (uInt rownr, String* dataPtr)
virtual void getArrayV (uInt rownr, void* dataPtr)
IPosition getResult (uInt rownr, void* dataPtr)
void clearCurResult()

Description

Review Status

Reviewed By:
GvD
Date Reviewed:
2004/07/09

Prerequisite

Synopsis

DummyVirtualScalar is an example of how to implement a virtual column class handling a scalar. This class scales the data in table column "DATA1" from Int to double and back using a scale factor given at construction time. This class is used by DummyVirtualColumn which is the engine for handling this scalar column and another column.

Motivation

This class is an example for writers of real virtual column classes. It is tested by tVirtColEng.cc.

Member Description

VirtualTaQLColumn (const String& expr)

Construct it with the given TaQL expression.

VirtualTaQLColumn (const Record& spec)

Construct it with the given specification.

virtual ~VirtualTaQLColumn()

Destructor is mandatory.

virtual DataManager* clone() const

Clone the engine object.

virtual Record dataManagerSpec() const

Get the data manager specification.

virtual String dataManagerType() const

Return the type name of the engine. (i.e. its class name VirtualTaQLColumn).

static void registerClass()

Register the class name and the static makeObject "constructor". This will make the engine known to the table system.

const String& expression() const

Return the TaQL expression used.

virtual int dataType() const
virtual Bool isWritable() const
virtual uInt ndim (uInt rownr)
virtual IPosition shape (uInt rownr)
virtual Bool isShapeDefined (uInt rownr)

Functions to return column info.

VirtualTaQLColumn (const VirtualTaQLColumn&)

Copy is not needed and therefore forbidden (so it is made private).

VirtualTaQLColumn& operator= (const VirtualTaQLColumn&)

Assignment is not needed and therefore forbidden (so it is made private).

virtual DataManagerColumn* makeScalarColumn (const String& columnName, int dataType, const String&)

Create the column object for the scalar column in this engine.

virtual DataManagerColumn* makeIndArrColumn (const String& columnName, int dataType, const String& dataTypeId)

Create the column object for the indirect array column in this engine.

virtual void create (uInt)

Let the engine initialize the object for a new table. It defines a column keyword holding the expression.

virtual void prepare()

Prepare compiles the expression.

static DataManager* makeObject (const String& dataManagerName, const Record& spec)

Define the "constructor" to construct this engine when a table is read back. This "constructor" has to be registered by the user of the engine. If the engine is commonly used, its registration can be added into the registerAllCtor function in DataManReg.cc. This function gets automatically invoked by the table system.

virtual void getBoolV (uInt rownr, Bool* dataPtr)
virtual void getuCharV (uInt rownr, uChar* dataPtr)
virtual void getShortV (uInt rownr, Short* dataPtr)
virtual void getuShortV (uInt rownr, uShort* dataPtr)
virtual void getIntV (uInt rownr, Int* dataPtr)
virtual void getuIntV (uInt rownr, uInt* dataPtr)
virtual void getfloatV (uInt rownr, float* dataPtr)
virtual void getdoubleV (uInt rownr, double* dataPtr)
virtual void getComplexV (uInt rownr, Complex* dataPtr)
virtual void getDComplexV (uInt rownr, DComplex* dataPtr)
virtual void getStringV (uInt rownr, String* dataPtr)

Get the scalar value in the given row. The default implementation throws an "invalid operation" exception.

virtual void getArrayV (uInt rownr, void* dataPtr)

Get the array value in the given row. The argument dataPtr is in fact an Array*, but a void* is needed to be generic. The array pointed to by dataPtr has to have the correct shape (which is guaranteed by the ArrayColumn get function). The default implementation throws an "invalid operation" exception.

IPosition getResult (uInt rownr, void* dataPtr)

Get the result.

void clearCurResult()

Clear the result cache.