casa::ForwardColumnEngine Class Reference
[Tables]

#include <ForwardCol.h>

Inheritance diagram for casa::ForwardColumnEngine:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Virtual column engine forwarding to other columns.

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Intended use:

Part of API

Prerequisite

Synopsis

ForwardColumnEngine is a data manager which forwards the gets and puts of columns to columns with the same names in another table. It is, in fact, a reference to the other table columns. The engine consists of a set of ForwardColumn objects, which handle the actual gets and puts.

Motivation

This class will be used by the calibration software. Most columns in a measurement table will be forwarded (thus bound to a ForwardColumnEngine object), while a few (i.e. the data themselves) will be calculated by a dedicated calibration engine.

Example

       // The original table.
       Table tab("someTable");
       // Create another table with the same description.
       SetupNewTable newtab("tForwardCol1.data", tab.tableDesc(), Table::New);
       // Create an engine which forwards to the original table.
       // Bind all columns in the new table to the forwarding engine.
       ForwardColumnEngine fce(tab);
       newtab.bindAll (fce);
       // Create the new table.
       // Every get and put on this table is forwarded to the original table.
       // NB. Puts cannot be done here, because the original table was
       //     opened as readonly.
       // Of course, some columns could have been bound to another
       // data manager (storage manager, calibration engine, .\..).
       Table forwTab(newtab);

Definition at line 364 of file ForwardCol.h.

Public Member Functions

 ForwardColumnEngine (const String &dataManagerName, const Record &spec)
 The default constructor is required for reconstruction of the engine when a table is read back.
 ForwardColumnEngine (const Table &referencedTable, const String &dataManagerName)
 Create the engine.
 ForwardColumnEngine (const Table &referencedTable)
 Create the engine.
 ~ForwardColumnEngine ()
 Destructor is mandatory.
DataManagerclone () const
 Clone the engine object.
String dataManagerName () const
 Return the name of the data manager.
String dataManagerType () const
 Return the type of the engine (i.e.
virtual Record dataManagerSpec () const
 Record a record containing data manager specifications.
const Stringsuffix () const
 Get the suffix to be used for names.
void setRefTable (const Table &refTable)
 Set RefTable_p if not set yet.

Static Public Member Functions

static void registerClass ()
 Register the class name and the static makeObject "constructor".
static DataManagermakeObject (const String &dataManagerType, const Record &spec)
 Define the "constructor" to construct this engine when a table is read back.

Protected Member Functions

void setSuffix (const String &suffix)
 Set the suffix.
void addForwardColumn (ForwardColumn *colp)
 Add a ForwardColumn object to the block.
const TablerefTable () const
 Get access to the refTable_p data member.
void baseCreate ()
 Do the creation (i.e.
void basePrepare ()
 Do the preparation of the engine by preparing all columns.

Private Member Functions

 ForwardColumnEngine (const ForwardColumnEngine &)
 The copy constructor is forbidden (so it is private).
ForwardColumnEngineoperator= (const ForwardColumnEngine &)
 Assignment is forbidden (so it is private).
Bool canAddRow () const
 This data manager allows to add rows.
Bool canRemoveRow () const
 This data manager allows to delete rows.
void addRow (uInt nrrow)
 Add rows to all columns.
void removeRow (uInt rownr)
 Delete a row from all columns.
Bool canAddColumn () const
 This data manager allows to add columns.
Bool canRemoveColumn () const
 This data manager allows to delete columns.
void addColumn (DataManagerColumn *)
 Add a column.
void removeColumn (DataManagerColumn *)
 Delete a column.
DataManagerColumnmakeScalarColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create the column object for the scalar column in this engine.
DataManagerColumnmakeIndArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create the column object for the indirect array column in this engine.
void create (uInt initialNrrow)
 Initialize the object for a new table.
void prepare ()
 Initialize the engine.
void reopenRW ()
 Reopen the engine for read/write access.

Private Attributes

PtrBlock< ForwardColumn * > refColumns_p
 Define the various engine column objects.
Table refTable_p
 The referenced table.
String dataManName_p
 The name of the data manager.
String suffix_p
 The suffix to be used in names.


Constructor & Destructor Documentation

casa::ForwardColumnEngine::ForwardColumnEngine ( const String dataManagerName,
const Record spec 
)

The default constructor is required for reconstruction of the engine when a table is read back.

casa::ForwardColumnEngine::ForwardColumnEngine ( const Table referencedTable,
const String dataManagerName 
)

Create the engine.

The columns using this engine will reference the given table. The data manager gets the given name.

casa::ForwardColumnEngine::ForwardColumnEngine ( const Table referencedTable  ) 

Create the engine.

The columns using this engine will reference the given table. The data manager has no name.

casa::ForwardColumnEngine::~ForwardColumnEngine (  ) 

Destructor is mandatory.

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

The copy constructor is forbidden (so it is private).


Member Function Documentation

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

Clone the engine object.

Implements casa::DataManager.

String casa::ForwardColumnEngine::dataManagerName (  )  const [virtual]

Return the name of the data manager.

This is the name of this instantiation of the data manager, thus not its type name.

Reimplemented from casa::DataManager.

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

Return the type of the engine (i.e.

its class name ForwardColumnEngine).

Implements casa::DataManager.

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

Record a record containing data manager specifications.

Reimplemented from casa::DataManager.

const String & casa::ForwardColumnEngine::suffix (  )  const [inline]

Get the suffix to be used for names.

Definition at line 514 of file ForwardCol.h.

References suffix_p.

Referenced by setSuffix().

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

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

This will make the engine known to the table system.

void casa::ForwardColumnEngine::setSuffix ( const String suffix  )  [inline, protected]

Set the suffix.

Definition at line 517 of file ForwardCol.h.

References suffix(), and suffix_p.

void casa::ForwardColumnEngine::addForwardColumn ( ForwardColumn colp  )  [protected]

Add a ForwardColumn object to the block.

const Table& casa::ForwardColumnEngine::refTable (  )  const [inline, protected]

Get access to the refTable_p data member.

Definition at line 414 of file ForwardCol.h.

References refTable_p.

void casa::ForwardColumnEngine::baseCreate (  )  [protected]

Do the creation (i.e.

initialization) of the engine.

void casa::ForwardColumnEngine::basePrepare (  )  [protected]

Do the preparation of the engine by preparing all columns.

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

Assignment is forbidden (so it is private).

Bool casa::ForwardColumnEngine::canAddRow (  )  const [private, virtual]

This data manager allows to add rows.

Reimplemented from casa::DataManager.

Bool casa::ForwardColumnEngine::canRemoveRow (  )  const [private, virtual]

This data manager allows to delete rows.

Reimplemented from casa::DataManager.

void casa::ForwardColumnEngine::addRow ( uInt  nrrow  )  [private, virtual]

Add rows to all columns.

This is not doing anything (but needed to override the default).

Reimplemented from casa::DataManager.

void casa::ForwardColumnEngine::removeRow ( uInt  rownr  )  [private, virtual]

Delete a row from all columns.

This is not doing anything (but needed to override the default).

Reimplemented from casa::DataManager.

Bool casa::ForwardColumnEngine::canAddColumn (  )  const [private, virtual]

This data manager allows to add columns.

Reimplemented from casa::DataManager.

Bool casa::ForwardColumnEngine::canRemoveColumn (  )  const [private, virtual]

This data manager allows to delete columns.

Reimplemented from casa::DataManager.

void casa::ForwardColumnEngine::addColumn ( DataManagerColumn  )  [private, virtual]

Add a column.

Reimplemented from casa::DataManager.

void casa::ForwardColumnEngine::removeColumn ( DataManagerColumn  )  [private, virtual]

Delete a column.

Reimplemented from casa::DataManager.

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

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

Reimplemented from casa::VirtualColumnEngine.

DataManagerColumn* casa::ForwardColumnEngine::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.

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

Initialize the object for a new table.

It defines the column keywords containing the name of the original table, which can be the parent of the referenced table.

Reimplemented from casa::VirtualColumnEngine.

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

Initialize the engine.

It gets the name of the original table(s) from the column keywords, opens those tables and attaches the ForwardColumn objects to the columns in those tables.

Reimplemented from casa::VirtualColumnEngine.

void casa::ForwardColumnEngine::reopenRW (  )  [private, virtual]

Reopen the engine for read/write access.

It makes all its columns writable if their underlying table is writable.

Reimplemented from casa::DataManager.

void casa::ForwardColumnEngine::setRefTable ( const Table refTable  ) 

Set RefTable_p if not set yet.

This is done by ForwardColumn to cover the case for existing tables where the default constructor of ForwardColumnEngine is used and refTable_p is not filled in.

static DataManager* casa::ForwardColumnEngine::makeObject ( const String dataManagerType,
const Record spec 
) [static]

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.


Member Data Documentation

PtrBlock<ForwardColumn*> casa::ForwardColumnEngine::refColumns_p [private]

Define the various engine column objects.

Definition at line 483 of file ForwardCol.h.

Table casa::ForwardColumnEngine::refTable_p [private]

The referenced table.

For newly created tables this is filled in by the constructor. For existing tables this is filled in by the first ForwardColumn object being constructed.

Definition at line 488 of file ForwardCol.h.

Referenced by refTable().

String casa::ForwardColumnEngine::dataManName_p [private]

The name of the data manager.

Definition at line 490 of file ForwardCol.h.

String casa::ForwardColumnEngine::suffix_p [private]

The suffix to be used in names.

Definition at line 492 of file ForwardCol.h.

Referenced by setSuffix(), and suffix().


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