An object of this class is created (and deleted) by the virtual column engine ForwardColumnIndexedRowEngine which creates a ForwardColumnIndexedRow object for each column being forwarded.
Destructor is mandatory.
Initialize the object. This means binding the column to the column with the same name in the original table. It checks if the description of both columns is the same.
Assignment is not needed and therefore forbidden (so make it private).
This data manager cannot handle changing array shapes.
This data manager cannot do get/putColumn.
This data manager cannot do get/putColumn.
This data manager cannot do get/putColumn.
Set the shape of an (indirect) array in the given row. This throws an exception, because putting is not supported.
Is the value shape defined in the given row?
Get the dimensionality of the item in the given row.
Get the shape of the item in the given row.
Get the scalar value with a standard data type in the given row.
Get the scalar value with a non-standard data type in the given row.
Put the scalar value with a standard data type into the given row. This throws an exception, because putting is not supported.
Put the scalar value with a non-standard data type into the given row. This throws an exception, because putting is not supported.
Get the array value in the given row.
The argument dataPtr is in fact a Array
Put the array value into the given row.
This throws an exception, because putting is not supported.
Get a section of the array in the given row.
The argument dataPtr is in fact a Array
Put into a section of the array in the given row.
This throws an exception, because putting is not supported.
Convert the rownr to the rownr in the underlying table.
For example:
Actually, puts are not possible. When multiple rows map to the same row
in the referenced table, putting a value in one row would also change
the value in another row referencing the same underlying row. This
could result in unexpected behaviour.
The engine consists of a set of
ForwardColumnIndexedRow
objects, which handle the actual gets.
Create the engine.
The columns using this engine will reference the given table.
The column with the given name contains the row number mapping,
i.e. a row number in a get or put is converted to a row number
in the referenced table using the value in this column.
The data manager gets the given name.
Create the engine.
The columns using this engine will reference the given table.
The column with the given name contains the row number mapping,
i.e. a row number in a get or put is converted to a row number
in the referenced table using the value in this column.
The data manager has no name.
Destructor is mandatory.
Clone the engine object.
Return the type name of the engine
(i.e. its class name ForwardColumnIndexedRowEngine).
Record a record containing data manager specifications.
Register the class name and the static makeObject "constructor".
This will make the engine known to the table system.
Assignment is forbidden (so it is private).
Create the column object for the scalar column in this engine.
Create the column object for the indirect array column in this engine.
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.
It also defines a keyword containing the row column name.
Initialize the engine.
It gets the name of the original table(s) from the column keywords,
opens those tables and attaches the ForwardColumnIndexedRow objects
to the columns in those tables.
Reopen the engine for read/write access.
This cannot be done, so all columns remain readonly.
The function is needed to override the behaviour of its base class.
Convert the rownr to the rownr in the underlying table.
void putArrayV (uInt rownr, const void* dataPtr)
void getSliceV (uInt rownr, const Slicer& slicer, void* dataPtr)
void putSliceV (uInt rownr, const Slicer& slicer, const void* dataPtr)
uInt convertRownr (uInt rownr)
class ForwardColumnIndexedRowEngine : public ForwardColumnEngine
Interface
Description
Prerequisite
Etymology
ForwardColumnIndexedRowEngine is a virtual column engine which
forwards the gets and puts of columns to corresponding columns
in another table. Furthermore it maps the row number by indexing
the row number in the referenced table.
Synopsis
ForwardColumnIndexedRowEngine is a data manager which forwards
the gets and puts of columns to columns with the same names in
another table. In that sense it is the same as the virtual column engine
ForwardColumnEngine.
However, it also forwards the row number. That is, it uses a column
containing row numbers to index the correct row in the referenced table.
The name of this column and the name of the referenced table have to
be given when constructing the engine.
Table TABA contains columns A, B and C and consists of N rows.
Table TABF uses ForwardColumnIndexedRowEngine to forward its columns
A, B and C to the corresponding columns in TABA. Furthermore it
contains a column ROW containing row numbers in TABA. This column is
the mapping of row numbers in TABF to rows in TABA. E.g. if ROW has
the value 25 in row 10, row 10 of TABF is forwarded to row 25 in TABA.
Motivation
In some ways it overlaps the functionality of the storage manager
StManMirAIO. They both allow to have the same value used by multiple
rows. However, StManMirAIO only allows that for consecutive rows,
while this engine allows it for any row. On the other side,
StManMirAIO is faster.
Example
// The original table.
Table tab("someTable");
// Create another table with the same description.
SetupNewTable newtab("tForwardColRow.data", tab.tableDesc(), Table::New);
// Create an engine which forwards to the original table and uses
// column rowColumn to get the row number in the referenced table.
// Bind all columns in the new table to the forwarding engine.
ForwardColumnIndexedRowEngine fce(tab, "rowColumn");
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);
Member Description
ForwardColumnIndexedRowEngine (const String& dataManagerName, const Record& spec)
The default constructor is required for reconstruction of the
engine when a table is read back.
ForwardColumnIndexedRowEngine (const Table& referencedTable, const String& rowColumnName, const String& dataManagerName)
ForwardColumnIndexedRowEngine (const Table& referencedTable, const String& rowColumnName)
~ForwardColumnIndexedRowEngine()
DataManager* clone() const
String dataManagerType() const
virtual Record dataManagerSpec() const
static void registerClass()
ForwardColumnIndexedRowEngine (const ForwardColumnIndexedRowEngine&)
The copy constructor is forbidden (so it is private).
ForwardColumnIndexedRowEngine& operator= (const ForwardColumnIndexedRowEngine&)
DataManagerColumn* makeScalarColumn (const String& columnName, int dataType, const String& dataTypeId)
DataManagerColumn* makeIndArrColumn (const String& columnName, int dataType, const String& dataTypeId)
void create (uInt initialNrrow)
void prepare()
void reopenRW()
static DataManager* makeObject (const String& dataManagerName, const Record& spec)
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.
uInt convertRownr (uInt rownr)