casa::VirtualTaQLColumn Class Reference
[Tables]

#include <VirtualTaQLColumn.h>

Inheritance diagram for casa::VirtualTaQLColumn:

Inheritance graph
[legend]
Collaboration diagram for casa::VirtualTaQLColumn:

Collaboration graph
[legend]
List of all members.

Detailed Description

Virtual scalar column using TaQL.

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.

Definition at line 66 of file VirtualTaQLColumn.h.

Public Member Functions

 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 DataManagerclone () 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.
const Stringexpression () const
 Return the TaQL expression used.
virtual int dataType () const
 Functions to return column info.
virtual Bool isWritable () const
 Test if data can be put into this column.
virtual uInt ndim (uInt rownr)
 Get the dimensionality of the item in the given row.
virtual IPosition shape (uInt rownr)
 Get the shape of the item in the given row.
virtual Bool isShapeDefined (uInt rownr)
 Is the value shape defined in the given row? By default it returns True.

Static Public Member Functions

static void registerClass ()
 Register the class name and the static makeObject "constructor".

Private Member Functions

 VirtualTaQLColumn (const VirtualTaQLColumn &)
 Copy is not needed and therefore forbidden (so it is made private).
VirtualTaQLColumnoperator= (const VirtualTaQLColumn &)
 Assignment is not needed and therefore forbidden (so it is made private).
virtual DataManagerColumnmakeScalarColumn (const String &columnName, int dataType, const String &)
 Create the column object for the scalar column in this engine.
virtual DataManagerColumnmakeIndArrColumn (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.
virtual void prepare ()
 Prepare compiles the expression.
virtual void getArrayV (uInt rownr, void *dataPtr)
 Get the array value in the given row.
IPosition getResult (uInt rownr, void *dataPtr)
 Get the result.
void clearCurResult ()
 Clear the result cache.
virtual void getBoolV (uInt rownr, Bool *dataPtr)
 Get the scalar value in the given row.
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)

Static Private Member Functions

static DataManagermakeObject (const String &dataManagerName, const Record &spec)
 Define the "constructor" to construct this engine when a table is read back.

Private Attributes

int itsDataType
Bool itsIsArray
String itsColumnName
String itsExpr
TableExprNodeitsNode
Bool itsTempWritable
Int itsCurRow
void * itsCurResult
IPosition itsCurShape


Constructor & Destructor Documentation

casa::VirtualTaQLColumn::VirtualTaQLColumn ( const String expr  ) 

Construct it with the given TaQL expression.

casa::VirtualTaQLColumn::VirtualTaQLColumn ( const Record spec  ) 

Construct it with the given specification.

virtual casa::VirtualTaQLColumn::~VirtualTaQLColumn (  )  [virtual]

Destructor is mandatory.

casa::VirtualTaQLColumn::VirtualTaQLColumn ( const VirtualTaQLColumn  )  [private]

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


Member Function Documentation

virtual DataManager* casa::VirtualTaQLColumn::clone (  )  const [virtual]

Clone the engine object.

Implements casa::DataManager.

virtual Record casa::VirtualTaQLColumn::dataManagerSpec (  )  const [virtual]

Get the data manager specification.

Reimplemented from casa::DataManager.

virtual String casa::VirtualTaQLColumn::dataManagerType (  )  const [virtual]

Return the type name of the engine.

(i.e. its class name VirtualTaQLColumn).

Implements casa::DataManager.

static void casa::VirtualTaQLColumn::registerClass (  )  [static]

Register the class name and the static makeObject "constructor".

This will make the engine known to the table system.

const String& casa::VirtualTaQLColumn::expression (  )  const [inline]

Return the TaQL expression used.

Definition at line 94 of file VirtualTaQLColumn.h.

References itsExpr.

virtual int casa::VirtualTaQLColumn::dataType (  )  const [virtual]

Functions to return column info.

Implements casa::DataManagerColumn.

virtual Bool casa::VirtualTaQLColumn::isWritable (  )  const [virtual]

Test if data can be put into this column.

This does not test if the data file is writable, only if it is in principle allowed to store data into the column. (It may not be allowed for virtual columns). The default is True.

Reimplemented from casa::DataManagerColumn.

virtual uInt casa::VirtualTaQLColumn::ndim ( uInt  rownr  )  [virtual]

Get the dimensionality of the item in the given row.

By default it returns shape(rownr).nelements().

Reimplemented from casa::DataManagerColumn.

virtual IPosition casa::VirtualTaQLColumn::shape ( uInt  rownr  )  [virtual]

Get the shape of the item in the given row.

By default it returns a zero-length IPosition (for a scalar value).

Reimplemented from casa::DataManagerColumn.

virtual Bool casa::VirtualTaQLColumn::isShapeDefined ( uInt  rownr  )  [virtual]

Is the value shape defined in the given row? By default it returns True.

Reimplemented from casa::DataManagerColumn.

VirtualTaQLColumn& casa::VirtualTaQLColumn::operator= ( const VirtualTaQLColumn  )  [private]

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

virtual DataManagerColumn* casa::VirtualTaQLColumn::makeScalarColumn ( const String columnName,
int  dataType,
const String  
) [private, virtual]

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

Reimplemented from casa::VirtualColumnEngine.

virtual DataManagerColumn* casa::VirtualTaQLColumn::makeIndArrColumn ( const String columnName,
int  dataType,
const String dataTypeId 
) [private, virtual]

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

Reimplemented from casa::VirtualColumnEngine.

virtual void casa::VirtualTaQLColumn::create ( uInt   )  [private, virtual]

Let the engine initialize the object for a new table.

It defines a column keyword holding the expression.

Reimplemented from casa::VirtualColumnEngine.

virtual void casa::VirtualTaQLColumn::prepare (  )  [private, virtual]

Prepare compiles the expression.

Reimplemented from casa::VirtualColumnEngine.

static DataManager* casa::VirtualTaQLColumn::makeObject ( const String dataManagerName,
const Record spec 
) [static, private]

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 casa::VirtualTaQLColumn::getBoolV ( uInt  rownr,
Bool dataPtr 
) [private, virtual]

Get the scalar value in the given row.

The default implementation throws an "invalid operation" exception.

Reimplemented from casa::DataManagerColumn.

virtual void casa::VirtualTaQLColumn::getuCharV ( uInt  rownr,
uChar dataPtr 
) [private, virtual]

Reimplemented from casa::DataManagerColumn.

virtual void casa::VirtualTaQLColumn::getShortV ( uInt  rownr,
Short dataPtr 
) [private, virtual]

Reimplemented from casa::DataManagerColumn.

virtual void casa::VirtualTaQLColumn::getuShortV ( uInt  rownr,
uShort dataPtr 
) [private, virtual]

Reimplemented from casa::DataManagerColumn.

virtual void casa::VirtualTaQLColumn::getIntV ( uInt  rownr,
Int dataPtr 
) [private, virtual]

Reimplemented from casa::DataManagerColumn.

virtual void casa::VirtualTaQLColumn::getuIntV ( uInt  rownr,
uInt dataPtr 
) [private, virtual]

Reimplemented from casa::DataManagerColumn.

virtual void casa::VirtualTaQLColumn::getfloatV ( uInt  rownr,
float *  dataPtr 
) [private, virtual]

Reimplemented from casa::DataManagerColumn.

virtual void casa::VirtualTaQLColumn::getdoubleV ( uInt  rownr,
double *  dataPtr 
) [private, virtual]

Reimplemented from casa::DataManagerColumn.

virtual void casa::VirtualTaQLColumn::getComplexV ( uInt  rownr,
Complex *  dataPtr 
) [private, virtual]

Reimplemented from casa::DataManagerColumn.

virtual void casa::VirtualTaQLColumn::getDComplexV ( uInt  rownr,
DComplex *  dataPtr 
) [private, virtual]

Reimplemented from casa::DataManagerColumn.

virtual void casa::VirtualTaQLColumn::getStringV ( uInt  rownr,
String dataPtr 
) [private, virtual]

Reimplemented from casa::DataManagerColumn.

virtual void casa::VirtualTaQLColumn::getArrayV ( uInt  rownr,
void *  dataPtr 
) [private, virtual]

Get the array value in the given row.

The argument dataPtr is in fact an Array<T>*, 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.

Reimplemented from casa::DataManagerColumn.

IPosition casa::VirtualTaQLColumn::getResult ( uInt  rownr,
void *  dataPtr 
) [private]

Get the result.

void casa::VirtualTaQLColumn::clearCurResult (  )  [private]

Clear the result cache.


Member Data Documentation

int casa::VirtualTaQLColumn::itsDataType [private]

Definition at line 176 of file VirtualTaQLColumn.h.

Bool casa::VirtualTaQLColumn::itsIsArray [private]

Definition at line 177 of file VirtualTaQLColumn.h.

String casa::VirtualTaQLColumn::itsColumnName [private]

Definition at line 178 of file VirtualTaQLColumn.h.

String casa::VirtualTaQLColumn::itsExpr [private]

Definition at line 179 of file VirtualTaQLColumn.h.

Referenced by expression().

TableExprNode* casa::VirtualTaQLColumn::itsNode [private]

Definition at line 180 of file VirtualTaQLColumn.h.

Bool casa::VirtualTaQLColumn::itsTempWritable [private]

Definition at line 181 of file VirtualTaQLColumn.h.

Int casa::VirtualTaQLColumn::itsCurRow [private]

Definition at line 182 of file VirtualTaQLColumn.h.

void* casa::VirtualTaQLColumn::itsCurResult [private]

Definition at line 183 of file VirtualTaQLColumn.h.

IPosition casa::VirtualTaQLColumn::itsCurShape [private]

Definition at line 184 of file VirtualTaQLColumn.h.


The documentation for this class was generated from the following file:
Generated on Mon Sep 1 22:45:53 2008 for NRAOCASA by  doxygen 1.5.1