The actual handling of a column by the data manager is defined in the abstract base class DataManagerColumn. Each data manager must have an associated class (derived from DataManagerColumn) to handle the columns.
There is a protocol defined how a data manager is created and initialized. For a new table it is:
SetupNewTable newtab("name.data", Table::New); // set up new table StManAipsIO stman; // define storage manager newtab.bindColumn ("column1", stman); // bind column to st.man. newtab.bindColumn ("column2", stman); // bind column to st.man. Table tab(newtab); // actually create tableWhen the given data manager object is used for the first time in a bind function, a copy of the object is made using the clone function. Thus in the above example column1 and column2 share the same data manager; only at the first bind the stman object is cloned. Columns not explicitly bound to a data manager get implicitly bound to the default data manager (as defined in the column description) by the Table constructor (as used in line 5).
Make a clone of the derived object.
Return the name of the data manager. This is the name of this instantiation of the data manager, thus not its type name. By default it returns an empty string.
Return the type name of the data manager (in fact its class name). It has to be a unique name, thus if the class is templated the template parameter has to be part of the name. This is used by the open/flush mechanism to be able to reconstruct the correct data manager.
Record a record containing data manager specifications. The default impementation returns an empty record.
Is the data manager a storage manager? The default is yes.
Tell if the data manager wants to reallocate the data manager column objects. This is used by the tiling storage manager. By default it returns False.
Reallocate the column object if it is part of this data manager. It returns a pointer to the new column object. This function is used by the tiling storage manager. By default it does nothing and returns the input pointer.
Get the (unique) sequence nr of this data manager.
Get the nr of columns in this data manager (can be zero).
Have the data to be stored in big or little endian canonical format?
Compose a keyword name from the given keyword appended with the sequence number (e.g. key_0). This makes the keyword name unique if multiple data managers are used with the same type.
Compose a unique filename from the table name and sequence number.
Get the AipsIO option of the underlying file.
Get the table this object is associated with.
Reopen the data manager for read/write access. By default it is assumed that a reopen for read/write does not have to do anything.
Does the data manager allow to add rows? (default no)
Does the data manager allow to delete rows? (default no)
Does the data manager allow to add columns? (default no)
Does the data manager allow to delete columns? (default no)
Set the maximum cache size (in bytes) to be used by a storage manager. The default implementation does nothing.
Create a column in the data manager on behalf of a table column. It calls makeXColumn and checks the data type.
Create a scalar column.
The dataTypeId argument is gives the id (i.e. name)
of the data type of the column. It is only used for virtual
columns of a non-standard data type to be able to check if
the correctness of the column data type.
Storage managers only handle standard data types and
can readily ignore this argument.
Create a column in the data manager on behalf of a table column. It calls makeXColumn and checks the data type.
Create a direct array column.
Create a column in the data manager on behalf of a table column. It calls makeXColumn and checks the data type.
Create an indirect array column.
The data manager will be deleted (because all its columns are requested to be deleted). So clean up the things needed (e.g. delete files).
Tell the data manager if big or little endian format is needed.
Throw an exception in case data type is TpOther, because the storage managers (and maybe other data managers) do not support such columns.
The copy constructor cannot be used for this base class. The clone function should be used instead. The private declaration of this constructor makes it unusable.
Assignment cannot be used for this base class. The private declaration of this operator makes it unusable.
Create a column in the data manager on behalf of a table column.
Create a scalar column.
Create a column in the data manager on behalf of a table column.
Create a direct array column.
Create a column in the data manager on behalf of a table column.
Create an indirect array column.
Check if the data type of the created data manager column is correct.
Add rows to all columns. The default implementation throws a "not possible" exception.
Delete a row from all columns. The default implementation throws a "not possible" exception.
Add a column. The default implementation throws a "not possible" exception.
Delete a column. The default implementation throws a "not possible" exception.
Set the sequence number of this data manager.
Link the data manager to the Table object.
Flush and optionally fsync the data. The AipsIO stream represents the main table file and can be used by virtual column engines to store SMALL amounts of data. It returns a True status if it had to flush (i.e. if data have changed).
Let the data manager initialize itself for a new table.
Let the data manager initialize itself for an existing table. The AipsIO stream represents the main table file and must be used by virtual column engines to retrieve the data stored in the flush function.
Resync the data by rereading cached data from the file. This is called when a lock is acquired on the file and it appears that data in this data manager has been changed by another process.
Let the data manager initialize itself further. Prepare is called after create/open has been called for all columns. In this way one can be sure that referenced columns are read back and partly initialized. The default implementation does nothing.
Get the "constructor" of a data manager.
Test if the data manager is registered.
Register all mappings. This will be a bunch of register calls. It is implemented in DataManReg.cc. In this way it is easier to add new functions to it (or maybe eventually automate that process).
Serve as default function for registerMap, which catches all unknown data manager types.
Has the object already been cloned?
Set the pointer to the clone.
In the synopsis of class DataManager it is described how the (derived) DataManagerColumn objects gets created and deleted.
DataManagerColumn defines various virtual functions to get or put (slices) of data in a column. These functions are called by the table column classes ScalarColumnData and ArrayColumnData. It does not define functions create, open, flush and prepare like those defined in DataManager. It is left to the derived classes to define those as needed and to interact properly with their data manager object.
Frees up the storage.
Set the isFixedShape flag.
Is this a fixed shape column?
Get the data type of the column as defined in DataType.h.
Get the data type id of the column for dataType==TpOther. The default implementation returns an emptry string. This function is required for virtual column engines handling non-standard data types. It is used to check the data type.
Test if data can be put into this column. This does not test if the data file is writable, only if it is in principle allowed to store data into the column. (It may not be allowed for virtual columns). The default is True.
Set the maximum length of the value (can be used for strings). By default the maximum length is ignored.
Set the shape of all (fixed-shaped) arrays in the column. Effectively it is the same as setShapeColumn, but it also sets the isFixedShape_p flag.
Set the shape of an (variable-shaped) array in the given row. By default it throws a "not possible" exception.
Set the shape and tile shape of an (variable-shaped) array in the given row. By default it ignores the tile shape (thus only sets the shape).
Is the value shape defined in the given row? By default it returns True.
Get the dimensionality of the item in the given row. By default it returns shape(rownr).nelements().
Get the shape of the item in the given row. By default it returns a zero-length IPosition (for a scalar value).
Can the data manager handle chaging the shape of an existing array? Default is no.
Can the column data manager handle access to a scalar column?
If not, the caller should access the column by looping through
all cells in the column.
Default is no.
The returned reask switch determines if the information is
permanent. False indicates it is permanent; True indicates it
will be reasked for the next get/putColumn.
By default reask is set to False.
Can the column data manager handle access to a clooection of cells
in a scalar column?
If not, the caller should access the column cells by looping through
the cells in the column.
Default is no.
The returned reask switch determines if the information is
permanent. False indicates it is permanent; True indicates it
will be reasked for the next get/putColumn.
By default reask is set to False.
Can the column data manager handle access to a scalar column?
If not, the caller should access the column by looping through
all cells in the column.
Default is no.
The returned reask switch determines if the information is
permanent. False indicates it is permanent; True indicates it
will be reasked for the next get/putColumn.
By default reask is set to False.
Can the column data manager handle access to a collection of cells
in an array column?
If not, the caller should access the column cells by looping through
the cells in the column.
Default is no.
The returned reask switch determines if the information is
permanent. False indicates it is permanent; True indicates it
will be reasked for the next get/putColumn.
By default reask is set to False.
Can the column data manager handle access to a cell slice?
If not, the caller should do slicing itself (by accessing the
entire array and slicing it).
Default is no.
The returned reask switch determines if the information is
permanent. False indicates it is permanent; True indicates it
will be reasked for the next get/putColumn.
By default reask is set to False.
Can the column data manager handle access to a column slice?
If not, the caller should access the column slice by looping through
all cell slices in the column.
Default is no.
The returned reask switch determines if the information is
permanent. False indicates it is permanent; True indicates it
will be reasked for the next get/putColumn.
By default reask is set to False.
Get access to the ColumnCache object.
Get the scalar value in the given row. These functions are non-virtual and are converted to their virtual getV equivalent to achieve that a derived templated class (like VirtualScalarColumn) does not have to declare and implement all these functions. The compiler complains about hiding virtual functions if you do not declare all virtual functions with the same name in a derived class.
This function is the get for all non-standard data types.
Get the scalar value in the given row. These functions are non-virtual and are converted to their virtual getV equivalent to achieve that a derived templated class (like VirtualScalarColumn) does not have to declare and implement all these functions. The compiler complains about hiding virtual functions if you do not declare all virtual functions with the same name in a derived class.
Put the scalar value into the given row. These functions are non-virtual and are converted to their virtual putV equivalent to achieve that a derived templated class (like VirtualScalarColumn) does not have to declare and implement all these functions. The compiler complains about hiding virtual functions if you do not declare all virtual functions with the same name in a derived class.
This function is the put for all non-standard data types.
Put the scalar value into the given row. These functions are non-virtual and are converted to their virtual putV equivalent to achieve that a derived templated class (like VirtualScalarColumn) does not have to declare and implement all these functions. The compiler complains about hiding virtual functions if you do not declare all virtual functions with the same name in a derived class.
Get all scalar values in the column.
The argument dataPtr is in fact a Vector
Put all scalar values in the column.
The argument dataPtr is in fact a const Vector
Get some scalar values in the column.
The argument dataPtr is in fact a Vector
Put some scalar values in the column.
The argument dataPtr is in fact a const Vector
Get scalars from the given row on with a maximum of nrmax values.
It returns the actual number of values got.
This can be used to get an entire column of scalars or to get
a part of a column (for a cache for example).
The argument dataPtr is in fact a T*, but a void*
is needed to be generic.
The default implementation throws an "invalid operation" exception.
Put nrmax scalars from the given row on.
It returns the actual number of values put.
This can be used to put an entire column of scalars or to put
a part of a column (for a cache for example).
The argument dataPtr is in fact a const T*, but a const void*
is needed to be generic.
The default implementation throws an "invalid operation" exception.
Get the array value in the given row.
The argument dataPtr is in fact an Array
Put the array value into the given row.
The argument dataPtr is in fact a const Array
Get all array values in the column.
The argument dataPtr is in fact an Array
Put all array values in the column.
The argument dataPtr is in fact a const Array
Get some array values in the column.
The argument dataPtr is in fact an Array
Put some array values in the column.
The argument dataPtr is in fact an const Array
Get a section of the array in the given row.
The argument dataPtr is in fact an Array
Put into a section of the array in the given row.
The argument dataPtr is in fact a const Array
Get a section of all arrays in the column.
The argument dataPtr is in fact an Array
Put into a section of all arrays in the column.
The argument dataPtr is in fact a const Array
Get a section of some arrays in the column.
The argument dataPtr is in fact an Array
Put into a section of some arrays in the column.
The argument dataPtr is in fact a const Array
Throw an "invalid operation" exception for the default
implementation of get.
Throw an "invalid operation" exception for the default
implementation of put.
This function is the get for all non-standard data types.
Put the scalar value into the given row.
The default implementation throws an "invalid operation" exception.
This function is the put for all non-standard data types.
Put the scalar value into the given row.
The default implementation throws an "invalid operation" exception.
Set the shape of all (fixed-shaped) arrays in the column.
By default it throws a "not possible" exception.
The copy constructor cannot be used for this base class.
The private declaration of this constructor makes it unusable.
Assignment cannot be used for this base class.
The private declaration of this operator makes it unusable.
virtual void putScalarColumnV (const void* dataPtr)
virtual void getScalarColumnCellsV (const RefRows& rownrs, void* dataPtr)
virtual void putScalarColumnCellsV (const RefRows& rownrs, const void* dataPtr)
virtual uInt getBlockV (uInt rownr, uInt nrmax, void* dataPtr)
virtual void putBlockV (uInt rownr, uInt nrmax, const void* dataPtr)
virtual void getArrayV (uInt rownr, void* dataPtr)
virtual void putArrayV (uInt rownr, const void* dataPtr)
virtual void getArrayColumnV (void* dataPtr)
virtual void putArrayColumnV (const void* dataPtr)
virtual void getArrayColumnCellsV (const RefRows& rownrs, void* dataPtr)
virtual void putArrayColumnCellsV (const RefRows& rownrs, const void* dataPtr)
virtual void getSliceV (uInt rownr, const Slicer& slicer, void* dataPtr)
virtual void putSliceV (uInt rownr, const Slicer& slicer, const void* dataPtr)
virtual void getColumnSliceV (const Slicer& slicer, void* dataPtr)
virtual void putColumnSliceV (const Slicer& slicer, const void* dataPtr)
virtual void getColumnSliceCellsV (const RefRows& rownrs, const Slicer& slicer, void* dataPtr)
virtual void putColumnSliceCellsV (const RefRows& rownrs, const Slicer& slicer, const void* dataPtr)
void throwGet() const
void throwPut() const
virtual void getOtherV (uInt rownr, void* dataPtr)
Get the scalar value in the given row.
The default implementation throws an "invalid operation" exception.
virtual void getBoolV (uInt rownr, Bool* dataPtr)
Get the scalar value in the given row.
The default implementation throws an "invalid operation" exception.
virtual void getuCharV (uInt rownr, uChar* dataPtr)
virtual void getShortV (uInt rownr, Short* dataPtr)
virtual void getuShortV (uInt rownr, uShort* dataPtr)
virtual void getIntV (uInt rownr, Int* dataPtr)
virtual void getuIntV (uInt rownr, uInt* dataPtr)
virtual void getfloatV (uInt rownr, float* dataPtr)
virtual void getdoubleV (uInt rownr, double* dataPtr)
virtual void getComplexV (uInt rownr, Complex* dataPtr)
virtual void getDComplexV (uInt rownr, DComplex* dataPtr)
virtual void getStringV (uInt rownr, String* dataPtr)
virtual void putOtherV (uInt rownr, const void* dataPtr)
virtual void putBoolV (uInt rownr, const Bool* dataPtr)
virtual void putuCharV (uInt rownr, const uChar* dataPtr)
virtual void putShortV (uInt rownr, const Short* dataPtr)
virtual void putuShortV (uInt rownr, const uShort* dataPtr)
virtual void putIntV (uInt rownr, const Int* dataPtr)
virtual void putuIntV (uInt rownr, const uInt* dataPtr)
virtual void putfloatV (uInt rownr, const float* dataPtr)
virtual void putdoubleV (uInt rownr, const double* dataPtr)
virtual void putComplexV (uInt rownr, const Complex* dataPtr)
virtual void putDComplexV (uInt rownr, const DComplex* dataPtr)
virtual void putStringV (uInt rownr, const String* dataPtr)
virtual void setShapeColumn (const IPosition& shape)
DataManagerColumn (const DataManagerColumn&)
DataManagerColumn& operator= (const DataManagerColumn&)