TableCopy.h

Classes

TableCopy -- Class with static functions for copying a table. (full description)

class TableCopy

Interface

Public Members
static Table makeEmptyTable (const String& newName, const Record& dataManagerInfo, const Table& tab, Table::TableOption option, Table::EndianFormat endianFormat, Bool replaceTSM = True, Bool noRows = False)
static Table makeEmptyMemoryTable (const String& newName, const Table& tab, Bool noRows = False)
static void copyRows (Table& out, const Table& in)
static void copyRows (Table& out, const Table& in, uInt startout, uInt startin, uInt nrrow)
static void copyInfo (Table& out, const Table& in)
static void copySubTables (Table& out, const Table& in, Bool noRows=False)
static void copySubTables (TableRecord& outKeys, const TableRecord& inKeys, const String& outName, Table::TableType outType, const Table& in, Bool noRows=False)
static void adjustTSM (TableDesc& tabDesc, Record& dminfo)
static void adjustDesc (TableDesc& tabDesc, const Record& dminfo)

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Prerequisite

Synopsis

TableCopy is a class for making a deep copy of a table. The table can be a PlainTable or a RefTable. It contains the following static functions:
  1. makeEmptyTable creates a new table using the description and storage managers of the input table. By default TiledDataStMan (which is more or less obsolete) will be replaced by TiledShapeStMan. By default the new table contains the same number of rows as the existing table.
  2. copyRows copies the data of one to another table. It is possible to specify where to start in the input and output.
  3. CopyInfo copies the table info data.
  4. copySubTables copies all the subtables in table and column keywords. It is done recursively.

Member Description

static Table makeEmptyTable (const String& newName, const Record& dataManagerInfo, const Table& tab, Table::TableOption option, Table::EndianFormat endianFormat, Bool replaceTSM = True, Bool noRows = False)

Make an (empty) table with the given description. If the description contains no columns, the description of the input table is used, so it has the same keywords and columns as the input one. The data managers can be given in the dataManagerInfo record. If it is empty, the info is taken from the input table. By default, the TiledDataStMan will be replaced by the TiledShapeStMan. By default, the new table has the same nr of rows as the input table. If noRows=True is given, it does not contain any row.

static Table makeEmptyMemoryTable (const String& newName, const Table& tab, Bool noRows = False)

Make an (empty) memory table with the same layout as the input one. It has the same keywords and columns as the input one. By default, the new table has the same nr of rows as the input table. If noRows=True is given, it does not contain any row.

static void copyRows (Table& out, const Table& in)
static void copyRows (Table& out, const Table& in, uInt startout, uInt startin, uInt nrrow)

Copy rows from the input to the output. By default all rows will be copied starting at row 0 of the output. Rows will be added to the output table as needed.
All columns in Table out will be filled from the column with the same name in table in. In principle only stored columns will be filled; however if the output table has only one column, it can also be a virtual one.

static void copyInfo (Table& out, const Table& in)

Copy the table info block from input to output table.

static void copySubTables (Table& out, const Table& in, Bool noRows=False)

Copy all subtables (in table and column keywords) from input to output table. Optionally the row contents are not copied.

static void copySubTables (TableRecord& outKeys, const TableRecord& inKeys, const String& outName, Table::TableType outType, const Table& in, Bool noRows=False)

Copy the subtables in the given keywordset to the output keywordset in the table with the given name.

static void adjustTSM (TableDesc& tabDesc, Record& dminfo)

Replace TiledDataStMan by TiledShapeStMan in the DataManagerInfo record. Since TiledShapeStMan does not support ID columns, they are adjusted as well in tabDesc and dminfo.

static void adjustDesc (TableDesc& tabDesc, const Record& dminfo)

Adjust the data manager types and groups and the hypercolumn definitions to the actual data manager info.