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.
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 414 of file ForwardCol.h.
casacore::ForwardColumnEngine::ForwardColumnEngine | ( | const String & | dataManagerName, | |
const Record & | spec | |||
) |
The default constructor is required for reconstruction of the engine when a table is read back.
casacore::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.
casacore::ForwardColumnEngine::ForwardColumnEngine | ( | const Table & | referencedTable | ) |
Create the engine.
The columns using this engine will reference the given table. The data manager has no name.
casacore::ForwardColumnEngine::~ForwardColumnEngine | ( | ) |
Destructor is mandatory.
casacore::ForwardColumnEngine::ForwardColumnEngine | ( | const ForwardColumnEngine & | ) | [private] |
The copy constructor is forbidden (so it is private).
void casacore::ForwardColumnEngine::addColumn | ( | DataManagerColumn * | ) | [private, virtual] |
Add a column.
Reimplemented from casacore::DataManager.
void casacore::ForwardColumnEngine::addForwardColumn | ( | ForwardColumn * | colp | ) | [protected] |
Add a ForwardColumn object to the block.
void casacore::ForwardColumnEngine::addRow | ( | uInt | nrrow | ) | [private, virtual] |
Add rows to all columns.
This is not doing anything (but needed to override the default).
Reimplemented from casacore::VirtualColumnEngine.
void casacore::ForwardColumnEngine::baseCreate | ( | ) | [protected] |
Do the creation (i.e.
initialization) of the engine.
void casacore::ForwardColumnEngine::basePrepare | ( | ) | [protected] |
Do the preparation of the engine by preparing all columns.
Bool casacore::ForwardColumnEngine::canAddColumn | ( | ) | const [private, virtual] |
This data manager allows to add columns.
Reimplemented from casacore::DataManager.
Bool casacore::ForwardColumnEngine::canAddRow | ( | ) | const [private, virtual] |
This data manager allows to add rows.
Reimplemented from casacore::VirtualColumnEngine.
Bool casacore::ForwardColumnEngine::canRemoveColumn | ( | ) | const [private, virtual] |
This data manager allows to delete columns.
Reimplemented from casacore::DataManager.
Bool casacore::ForwardColumnEngine::canRemoveRow | ( | ) | const [private, virtual] |
This data manager allows to delete rows.
Reimplemented from casacore::VirtualColumnEngine.
static String casacore::ForwardColumnEngine::className | ( | ) | [static] |
Return the name of the class.
Reimplemented in casacore::ForwardColumnIndexedRowEngine.
DataManager* casacore::ForwardColumnEngine::clone | ( | ) | const [virtual] |
Clone the engine object.
Implements casacore::DataManager.
Reimplemented in casacore::ForwardColumnIndexedRowEngine.
void casacore::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 casacore::VirtualColumnEngine.
Reimplemented in casacore::ForwardColumnIndexedRowEngine.
String casacore::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 casacore::DataManager.
virtual Record casacore::ForwardColumnEngine::dataManagerSpec | ( | ) | const [virtual] |
Record a record containing data manager specifications.
Reimplemented from casacore::DataManager.
Reimplemented in casacore::ForwardColumnIndexedRowEngine.
String casacore::ForwardColumnEngine::dataManagerType | ( | ) | const [virtual] |
Return the type of the engine (i.e.
its class name ForwardColumnEngine).
Implements casacore::DataManager.
Reimplemented in casacore::ForwardColumnIndexedRowEngine.
DataManagerColumn* casacore::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 casacore::VirtualColumnEngine.
Reimplemented in casacore::ForwardColumnIndexedRowEngine.
static DataManager* casacore::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 casacore::ForwardColumnIndexedRowEngine.
DataManagerColumn* casacore::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 casacore::VirtualColumnEngine.
Reimplemented in casacore::ForwardColumnIndexedRowEngine.
ForwardColumnEngine& casacore::ForwardColumnEngine::operator= | ( | const ForwardColumnEngine & | ) | [private] |
Assignment is forbidden (so it is private).
Reimplemented from casacore::VirtualColumnEngine.
Reimplemented in casacore::ForwardColumnIndexedRowEngine.
void casacore::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 casacore::VirtualColumnEngine.
Reimplemented in casacore::ForwardColumnIndexedRowEngine.
const Table& casacore::ForwardColumnEngine::refTable | ( | ) | const [inline, protected] |
Get access to the refTable_p data member.
Definition at line 467 of file ForwardCol.h.
References refTable_p.
static void casacore::ForwardColumnEngine::registerClass | ( | ) | [static] |
Register the class name and the static makeObject "constructor".
This will make the engine known to the table system.
Reimplemented in casacore::ForwardColumnIndexedRowEngine.
void casacore::ForwardColumnEngine::removeColumn | ( | DataManagerColumn * | ) | [private, virtual] |
Delete a column.
Reimplemented from casacore::DataManager.
void casacore::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 casacore::VirtualColumnEngine.
void casacore::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 casacore::DataManager.
Reimplemented in casacore::ForwardColumnIndexedRowEngine.
void casacore::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 casacore::ForwardColumnEngine::setSuffix | ( | const String & | suffix | ) | [inline, protected] |
const String & casacore::ForwardColumnEngine::suffix | ( | ) | const [inline] |
Get the suffix to be used for names.
Definition at line 567 of file ForwardCol.h.
References suffix_p.
The name of the data manager.
Definition at line 543 of file ForwardCol.h.
Define the various engine column objects.
Reimplemented in casacore::ForwardColumnIndexedRowEngine.
Definition at line 536 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 541 of file ForwardCol.h.
Referenced by refTable().
The suffix to be used in names.
Definition at line 545 of file ForwardCol.h.
Referenced by setSuffix(), and suffix().