casa
$Rev:20696$
|
Virtual column engine forwarding to other columns. More...
#include <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. | |
DataManager * | clone () 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 String & | suffix () 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 DataManager * | makeObject (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 Table & | refTable () 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). | |
ForwardColumnEngine & | operator= (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. | |
DataManagerColumn * | makeScalarColumn (const String &columnName, int dataType, const String &dataTypeId) |
Create the column object for the scalar column in this engine. | |
DataManagerColumn * | makeIndArrColumn (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. |
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>
Public interface
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.
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.
// 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.
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.
Destructor is mandatory.
casa::ForwardColumnEngine::ForwardColumnEngine | ( | const ForwardColumnEngine & | ) | [private] |
The copy constructor is forbidden (so it is private).
void casa::ForwardColumnEngine::addColumn | ( | DataManagerColumn * | ) | [private, virtual] |
Add a column.
Reimplemented from casa::DataManager.
void casa::ForwardColumnEngine::addForwardColumn | ( | ForwardColumn * | colp | ) | [protected] |
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.
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.
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.
static String casa::ForwardColumnEngine::className | ( | ) | [static] |
Return the name of the class.
Reimplemented in casa::ForwardColumnIndexedRowEngine.
DataManager* casa::ForwardColumnEngine::clone | ( | ) | const [virtual] |
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.
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.
virtual Record casa::ForwardColumnEngine::dataManagerSpec | ( | ) | const [virtual] |
Record a record containing data manager specifications.
Reimplemented from casa::DataManager.
Reimplemented in casa::ForwardColumnIndexedRowEngine.
String casa::ForwardColumnEngine::dataManagerType | ( | ) | const [virtual] |
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.
void casa::ForwardColumnEngine::removeColumn | ( | DataManagerColumn * | ) | [private, virtual] |
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] |
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().
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.
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 540 of file ForwardCol.h.
Referenced by refTable().
String casa::ForwardColumnEngine::suffix_p [private] |
The suffix to be used in names.
Definition at line 544 of file ForwardCol.h.
Referenced by setSuffix(), and suffix().