casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
casa::ForwardColumnEngine Class Reference

Virtual column engine forwarding to other columns. More...

#include <ForwardCol.h>

Inheritance diagram for casa::ForwardColumnEngine:
casa::VirtualColumnEngine casa::DataManager casa::ForwardColumnIndexedRowEngine

List of all members.

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 String className ()
 Return the name of the class.
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.

Detailed Description

Virtual column engine forwarding to other columns.

<h3>Review Status</h3><dl><dt>Reviewed By:<dd>UNKNOWN<dt>Date Reviewed:<dd>before2004/08/25</dl> 

Intended use:

Public interface

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 413 of file ForwardCol.h.


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.

Create the engine.

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

Destructor is mandatory.

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


Member Function Documentation

Add a column.

Reimplemented from casa::DataManager.

Add a ForwardColumn object to the block.

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::VirtualColumnEngine.

Do the creation (i.e.

initialization) of the engine.

Do the preparation of the engine by preparing all columns.

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

This data manager allows to add columns.

Reimplemented from casa::DataManager.

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

This data manager allows to add rows.

Reimplemented from casa::VirtualColumnEngine.

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

This data manager allows to delete columns.

Reimplemented from casa::DataManager.

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

This data manager allows to delete rows.

Reimplemented from casa::VirtualColumnEngine.

Return the name of the class.

Reimplemented in casa::ForwardColumnIndexedRowEngine.

Clone the engine object.

Implements casa::DataManager.

Reimplemented in casa::ForwardColumnIndexedRowEngine.

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.

Reimplemented in casa::ForwardColumnIndexedRowEngine.

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.

Record a record containing data manager specifications.

Reimplemented from casa::DataManager.

Reimplemented in casa::ForwardColumnIndexedRowEngine.

Return the type of the engine (i.e.

its class name ForwardColumnEngine).

Implements casa::DataManager.

Reimplemented in casa::ForwardColumnIndexedRowEngine.

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.

Reimplemented in casa::ForwardColumnIndexedRowEngine.

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.

Reimplemented in casa::ForwardColumnIndexedRowEngine.

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.

Reimplemented in casa::ForwardColumnIndexedRowEngine.

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

Assignment is forbidden (so it is private).

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.

Reimplemented in casa::ForwardColumnIndexedRowEngine.

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

Get access to the refTable_p data member.

Definition at line 466 of file ForwardCol.h.

References refTable_p.

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.

Reimplemented in casa::ForwardColumnIndexedRowEngine.

Delete a column.

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::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.

Reimplemented in casa::ForwardColumnIndexedRowEngine.

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.

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

Set the suffix.

Definition at line 569 of file ForwardCol.h.

References suffix(), and suffix_p.

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

Get the suffix to be used for names.

Definition at line 566 of file ForwardCol.h.

References suffix_p.

Referenced by setSuffix().


Member Data Documentation

The name of the data manager.

Definition at line 542 of file ForwardCol.h.

Define the various engine column objects.

Reimplemented in casa::ForwardColumnIndexedRowEngine.

Definition at line 535 of file ForwardCol.h.

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 540 of file ForwardCol.h.

Referenced by refTable().

The suffix to be used in names.

Definition at line 544 of file ForwardCol.h.

Referenced by setSuffix(), and suffix().


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