casa
5.7.0-16
|
Create a new table - define shapes, data managers, etc. More...
#include <SetupNewTab.h>
Public Member Functions | |
SetupNewTable (const String &tableName, const String &tableDescName, Table::TableOption, const StorageOption &=StorageOption()) | |
Create a new table using the table description with the given name. More... | |
SetupNewTable (const String &tableName, const TableDesc &, Table::TableOption, const StorageOption &=StorageOption()) | |
Create a new table using the given table description. More... | |
SetupNewTable (const SetupNewTable &) | |
Copy constructor (reference semantics). More... | |
~SetupNewTable () | |
SetupNewTable & | operator= (const SetupNewTable &) |
Assignment (reference semantics). More... | |
const String & | name () const |
Get the name of the table. More... | |
int | option () const |
Get the table create option. More... | |
const StorageOption & | storageOption () const |
Get the storage option. More... | |
Bool | isMarkedForDelete () const |
Test if the table is marked for delete. More... | |
const TableDesc & | tableDesc () const |
Get the table description. More... | |
void | adjustHypercolumns (const std::map< String, String > &old2new, Bool keepUnknown) |
Adjust the hypercolumn definitions. More... | |
void | bindColumn (const String &columnName, const DataManager &dm) |
Bind a column to the given data manager. More... | |
void | bindColumn (const String &columnName, const String &otherColumn) |
Bind a column to the given data manager of the other column. More... | |
void | bindGroup (const String &columnGroup, const DataManager &dm, Bool rebind=False) |
Bind a group of columns to the given data manager. More... | |
void | bindAll (const DataManager &dm, Bool rebind=False) |
Bind all columns to the given data manager. More... | |
void | bindCreate (const Record &spec) |
Create data managers and bind the columns using the specifications in the given record (which is obtained using Table::dataManagerInfo()). More... | |
void | setShapeColumn (const String &columnName, const IPosition &shape) |
Define the shape of fixed shaped arrays in a column. More... | |
Bool | isUsed () const |
Test if object is already in use. More... | |
Private Member Functions | |
ColumnSet * | columnSetPtr () |
Get pointer to column set. More... | |
TableDesc * | tableDescPtr () |
Get pointer to table description. More... | |
void | setInUse () |
Set object to in use by a (Plain)Table object. More... | |
void | handleUnbound () |
Make a data manager for all unbound columns. More... | |
Private Attributes | |
SetupNewTableRep * | newTable_p |
Actual object. More... | |
Friends | |
class | PlainTable |
class | MemoryTable |
Create a new table - define shapes, data managers, etc.
Public interface
SetupNewTable is a class to setup a new table.
Constructing a new table is a two stage process. First a SetupNewTable object has to be created. Thereafter its columns have to be bound defining how they have to be stored or calculated. Columns have to be bound to a data manager (e.g. a storage manager or a virtual column engine).. Once the required columns are bound, the actual Table object can be created. At this stage, still unbound columns will be bound to the default data managers. The Table object can be used to write data, etc.
The construct options for SetupNewTable are defined in class Table. The possible options are:
More information is provided in the Tables module documentation.
This code illustrates a simple function that creates a Table starting from a Table descriptor. I
In principle, SetupNewTab isn't necessary as what we are doing is logically just constructing a Table, so it could be done in the Table constructor. However such a process can be an involved one - binding multiple data managers and filling in the shapes of direct arrays - so separating the process makes it much clearer what is going on.
Definition at line 346 of file SetupNewTab.h.
casacore::SetupNewTable::SetupNewTable | ( | const String & | tableName, |
const String & | tableDescName, | ||
Table::TableOption | , | ||
const StorageOption & | = StorageOption() |
||
) |
Create a new table using the table description with the given name.
The description will be read from a file.
casacore::SetupNewTable::SetupNewTable | ( | const String & | tableName, |
const TableDesc & | , | ||
Table::TableOption | , | ||
const StorageOption & | = StorageOption() |
||
) |
Create a new table using the given table description.
casacore::SetupNewTable::SetupNewTable | ( | const SetupNewTable & | ) |
Copy constructor (reference semantics).
casacore::SetupNewTable::~SetupNewTable | ( | ) |
|
inline |
Adjust the hypercolumn definitions.
It renames and/or removes columns as necessary.
Definition at line 391 of file SetupNewTab.h.
References casacore::TableDesc::adjustHypercolumns(), newTable_p, and casacore::SetupNewTableRep::tableDescPtr().
|
inline |
Bind all columns to the given data manager.
The flag rebind tells if the binding of an already bound column will be overwritten. It cannot be used anymore once the SetupNewTable object is used to construct a Table object.
Definition at line 424 of file SetupNewTab.h.
References casacore::SetupNewTableRep::bindAll(), and newTable_p.
|
inline |
Bind a column to the given data manager.
If already bound, the binding will be overwritten. It cannot be used anymore once the SetupNewTable object is used to construct a Table object.
Definition at line 399 of file SetupNewTab.h.
References casacore::SetupNewTableRep::bindColumn(), and newTable_p.
|
inline |
Bind a column to the given data manager of the other column.
If the other column is not bound, nothing will be done. If columnName is already bound, the binding will be overwritten. It cannot be used anymore once the SetupNewTableRep object is used to construct a Table object.
Definition at line 407 of file SetupNewTab.h.
References casacore::SetupNewTableRep::bindColumn(), and newTable_p.
|
inline |
Create data managers and bind the columns using the specifications in the given record (which is obtained using Table::dataManagerInfo()).
Definition at line 429 of file SetupNewTab.h.
References casacore::SetupNewTableRep::bindCreate(), and newTable_p.
|
inline |
Bind a group of columns to the given data manager.
The flag rebind tells if the binding of an already bound column will be overwritten. It cannot be used anymore once the SetupNewTable object is used to construct a Table object.
Definition at line 415 of file SetupNewTab.h.
References casacore::SetupNewTableRep::bindGroup(), and newTable_p.
|
inlineprivate |
Get pointer to column set.
This function is used by PlainTable.
Definition at line 455 of file SetupNewTab.h.
References casacore::SetupNewTableRep::columnSetPtr(), and newTable_p.
|
inlineprivate |
Make a data manager for all unbound columns.
Definition at line 469 of file SetupNewTab.h.
References casacore::SetupNewTableRep::handleUnbound(), and newTable_p.
|
inline |
Test if the table is marked for delete.
Definition at line 382 of file SetupNewTab.h.
References casacore::SetupNewTableRep::isMarkedForDelete(), and newTable_p.
|
inline |
Test if object is already in use.
Definition at line 446 of file SetupNewTab.h.
References casacore::SetupNewTableRep::isUsed(), and newTable_p.
|
inline |
Get the name of the table.
Definition at line 370 of file SetupNewTab.h.
References casacore::SetupNewTableRep::name(), and newTable_p.
SetupNewTable& casacore::SetupNewTable::operator= | ( | const SetupNewTable & | ) |
Assignment (reference semantics).
|
inline |
Get the table create option.
Definition at line 374 of file SetupNewTab.h.
References newTable_p, and casacore::SetupNewTableRep::option().
|
inlineprivate |
Set object to in use by a (Plain)Table object.
This function is used by PlainTable.
Definition at line 465 of file SetupNewTab.h.
References newTable_p, and casacore::SetupNewTableRep::setInUse().
|
inline |
Define the shape of fixed shaped arrays in a column.
The shape of those arrays has to be known before the table can be constructed. It has to be defined via this function, if it was not already defined in the column description. If only the dimensionality was defined in the column description, the shape's dimensionality must match it. Calling this function for an non-fixed shaped array results in an exception. It cannot be used anymore once the SetupNewTable object is used to construct a Table object.
Definition at line 442 of file SetupNewTab.h.
References newTable_p, and casacore::SetupNewTableRep::setShapeColumn().
|
inline |
Get the storage option.
Definition at line 378 of file SetupNewTab.h.
References newTable_p, and casacore::SetupNewTableRep::storageOption().
|
inline |
Get the table description.
Definition at line 386 of file SetupNewTab.h.
References newTable_p, and casacore::SetupNewTableRep::tableDesc().
|
inlineprivate |
Get pointer to table description.
This function is used by PlainTable.
Definition at line 460 of file SetupNewTab.h.
References newTable_p, and casacore::SetupNewTableRep::tableDescPtr().
|
friend |
Definition at line 349 of file SetupNewTab.h.
|
friend |
Definition at line 348 of file SetupNewTab.h.
|
private |
Actual object.
Definition at line 451 of file SetupNewTab.h.
Referenced by adjustHypercolumns(), bindAll(), bindColumn(), bindCreate(), bindGroup(), columnSetPtr(), handleUnbound(), isMarkedForDelete(), isUsed(), name(), option(), setInUse(), setShapeColumn(), storageOption(), tableDesc(), and tableDescPtr().