casacore
|
High-level interface to tables. More...
#include <TableProxy.h>
Public Member Functions | |
TableProxy () | |
Default constructor initializes to not open. More... | |
TableProxy (const Table &table) | |
Create the object from an existing table (used by some methods). More... | |
TableProxy (const String &tableName, const Record &lockOptions, int option) | |
Open the table with a given name. More... | |
TableProxy (const String &tableName, const Record &lockOptions, const String &endianFormat, const String &memType, int nrow, const Record &tableDesc, const Record &dmInfo) | |
Create a table with given name and description, etc. More... | |
TableProxy (const Vector< String > &tableNames, const Vector< String > &concatenateSubTableNames, const Record &lockOptions, int option) | |
Create a table object to concatenate a number of similar tables. More... | |
TableProxy (const std::vector< TableProxy > &tables, const Vector< String > &concatenateSubTableNames, int dummy1=0, int dummy2=0, int dummy3=0) | |
TableProxy (const String &command, const std::vector< TableProxy > &tables) | |
Create a table object from a table command (as defined in TableGram). More... | |
TableProxy (const String &fileName, const String &headerName, const String &tableName, Bool autoHeader, const IPosition &autoShape, const String &separator, const String &commentMarker, Int firstLine, Int lastLine, const Vector< String > &columnNames=Vector< String >(), const Vector< String > &dataTypes=Vector< String >()) | |
Create a table from an Ascii file. More... | |
TableProxy (const TableProxy &) | |
Copy constructor. More... | |
~TableProxy () | |
Close the table. More... | |
TableProxy & | operator= (const TableProxy &) |
Assignment. More... | |
TableProxy | selectRows (const Vector< Int > &rownrs, const String &outName) |
Select the given rows from the table and create a new (reference) table. More... | |
void | reopenRW () |
Reopen the table for read/write. More... | |
void | resync () |
Resync the table. More... | |
void | flush (Bool recursive) |
Flush the table and optionally all its subtables. More... | |
void | close () |
Flush and close the table and all its subtables. More... | |
String | endianFormat () const |
Get the endian format of the table. More... | |
void | lock (Bool mode, Int nattempts) |
Acquire a (read or write) lock on the table. More... | |
void | unlock () |
Release a lock on the table. More... | |
Bool | hasDataChanged () |
Determine if data in the table has changed. More... | |
Bool | hasLock (Bool mode) |
Determine if the process has a read or write lock on the table. More... | |
Record | lockOptions () |
Get the lock options of the table. More... | |
Bool | isMultiUsed (Bool checkSubTables) |
Determine if the table (and optionally its subtables) are in use in another process. More... | |
String | toAscii (const String &asciiFile, const String &headerFile, const Vector< String > &columns, const String &sep, const Vector< Int > &precision, Bool useBrackets) |
Write the table to an ASCII file (approximately the inverse of the from-ASCII-contructor). More... | |
void | rename (const String &newTableName) |
Rename the table. More... | |
TableProxy | copy (const String &newTableName, Bool toMemoryTable, Bool deepCopy, Bool valueCopy, const String &endianFormat, const Record &dminfo, Bool noRows) |
Copy the table (possibly a deep copy). More... | |
void | copyRows (TableProxy &out, Int startIn, Int startOut, Int nrow) |
Copy rows from one table to another. More... | |
void | deleteTable (Bool checkSubTables) |
Close and delete the table. More... | |
Record | tableInfo () |
Get the table info of the table. More... | |
void | putTableInfo (const Record &value) |
Put the table info of the table. More... | |
void | addReadmeLine (const String &line) |
Add a line to the TableInfo readme. More... | |
Bool | isReadable () const |
Test if a table is readable. More... | |
Bool | isWritable () const |
Test if a table is writable. More... | |
void | setMaximumCacheSize (const String &columnName, Int nbytes) |
Set the maximum cache size for the given column in the table. More... | |
void | addColumns (const Record &tableDesc, const Record &dminfo, Bool addToParent) |
Add one or more columns to the table. More... | |
void | renameColumn (const String &nameOld, const String &nameNew) |
Rename a column in the table. More... | |
void | removeColumns (const Vector< String > &columnNames) |
Remove one or more columns from the table. More... | |
void | addRow (Int nrow) |
Add rows to the table. More... | |
void | removeRow (const Vector< Int > &rownrs) |
Remove rows from the table. More... | |
ValueHolder | getColumn (const String &columnName, Int row, Int nrow, Int incr) |
Get some or all values from a column in the table. More... | |
void | getColumnVH (const String &columnName, Int row, Int nrow, Int incr, const ValueHolder &vh) |
Record | getVarColumn (const String &columnName, Int row, Int nrow, Int incr) |
ValueHolder | getColumnSlice (const String &columnName, Int row, Int nrow, Int incr, const Vector< Int > &blc, const Vector< Int > &trc, const Vector< Int > &inc) |
Get some or all value slices from a column in the table. More... | |
ValueHolder | getColumnSliceIP (const String &columnName, const IPosition &blc, const IPosition &trc, const IPosition &inc, Int row, Int nrow, Int incr) |
void | getColumnSliceVH (const String &columnName, Int row, Int nrow, Int incr, const Vector< Int > &blc, const Vector< Int > &trc, const Vector< Int > &inc, const ValueHolder &vh) |
void | getColumnSliceVHIP (const String &columnName, const IPosition &blc, const IPosition &trc, const IPosition &inc, Int row, Int nrow, Int incr, const ValueHolder &vh) |
void | putColumn (const String &columnName, Int row, Int nrow, Int incr, const ValueHolder &) |
Put some or all values into a column in the table. More... | |
void | putVarColumn (const String &columnName, Int row, Int nrow, Int incr, const Record &values) |
void | putColumnSlice (const String &columnName, Int row, Int nrow, Int incr, const Vector< Int > &blc, const Vector< Int > &trc, const Vector< Int > &inc, const ValueHolder &) |
Put some or all value slices into a column in the table. More... | |
void | putColumnSliceIP (const String &columnName, const ValueHolder &, const IPosition &blc, const IPosition &trc, const IPosition &inc, Int row, Int nrow, Int incr) |
Bool | cellContentsDefined (const String &columnName, Int rownr) |
Tests if the contents of a cell are defined. More... | |
ValueHolder | getCell (const String &columnName, Int row) |
Get a value from a column in the table. More... | |
void | getCellVH (const String &columnName, Int row, const ValueHolder &vh) |
ValueHolder | getCellSlice (const String &columnName, Int row, const Vector< Int > &blc, const Vector< Int > &trc, const Vector< Int > &inc) |
Get a value slice from a column in the table. More... | |
ValueHolder | getCellSliceIP (const String &columnName, Int row, const IPosition &blc, const IPosition &trc, const IPosition &inc) |
void | getCellSliceVH (const String &columnName, Int row, const Vector< Int > &blc, const Vector< Int > &trc, const Vector< Int > &inc, const ValueHolder &vh) |
void | getCellSliceVHIP (const String &columnName, Int row, const IPosition &blc, const IPosition &trc, const IPosition &inc, const ValueHolder &vh) |
void | putCell (const String &columnName, const Vector< Int > &rownrs, const ValueHolder &) |
Put a value into a column in the table. More... | |
void | putCellSlice (const String &columnName, Int row, const Vector< Int > &blc, const Vector< Int > &trc, const Vector< Int > &inc, const ValueHolder &) |
Put a value slice into a column in the table. More... | |
void | putCellSliceIP (const String &columnName, Int row, const ValueHolder &, const IPosition &blc, const IPosition &trc, const IPosition &inc) |
Vector< String > | getColumnShapeString (const String &columnName, Int rownr, Int nrow, Int incr, Bool cOrder=False) |
Get the shape of one or more cells in a column as a vector of Strings containing the shapes as [a,b,c]. More... | |
ValueHolder | getKeyword (const String &columnName, const String &keywordName, Int keywordIndex) |
Get a table or column keyword value in the table. More... | |
Record | getKeywordSet (const String &columnName) |
Get the table or column keyword values in the table. More... | |
void | putKeyword (const String &columnName, const String &keywordName, Int keywordIndex, Bool makeSubRecord, const ValueHolder &) |
Define a table or column keyword in the table. More... | |
void | putKeywordSet (const String &columnName, const Record &valueSet) |
Define multiple table or column keywords in the table. More... | |
void | removeKeyword (const String &columnName, const String &keywordName, Int keywordIndex) |
Remove a table or column keyword from the table. More... | |
Vector< String > | getFieldNames (const String &columnName, const String &keywordName, Int keywordIndex) |
Get the names of all field in a record in the table. More... | |
String | tableName () |
Get table name. More... | |
Vector< String > | getPartNames (Bool recursive) |
Get the names of the parts the table consists of (e.g. More... | |
Int | ncolumns () |
Get #columns of the table. More... | |
Int | nrows () |
Get #rows of the table. More... | |
Vector< Int > | shape () |
Get the shape (#columns, #rows) of the table. More... | |
Vector< Int > | rowNumbers (TableProxy &other) |
Get the row numbers of the table. More... | |
Vector< String > | columnNames () |
Get all column names in the table. More... | |
Bool | isScalarColumn (const String &columnName) |
Return in result if the column contains scalars. More... | |
String | columnDataType (const String &columnName) |
Return the data type of the column as: Bool, UChar, Short, UShort, Int, UInt, Float, Double, Complex, DComplex, String, Table, or unknown. More... | |
String | columnArrayType (const String &columnName) |
Return the type of array in the column as: Direct Undefined FixedShape Direct,Undefined Direct,FixedShape Undefined,FixedShape Direct,Undefined,FixedShape or Error – unexpected column type. More... | |
Record | getDataManagerInfo () |
Get the data manager info of the table. More... | |
Record | getProperties (const String &name, Bool byColumn) |
Get the properties of a data manager given by column or data manager name. More... | |
void | setProperties (const String &name, Bool byColumn, const Record &properties) |
Set the properties of a data manager given by column or data manager name. More... | |
Record | getTableDescription (Bool actual, Bool cOrder=False) |
Get the table description of the table. More... | |
Record | getColumnDescription (const String &columnName, Bool actual, Bool cOrder=False) |
Get the column description of a column in the table. More... | |
String | getAsciiFormat () const |
Get ascii format string. More... | |
Record | getCalcResult () const |
Get result of possible CALC statement. More... | |
String | showStructure (Bool showDataMan=True, Bool showColumns=True, Bool showSubTables=False, Bool sortColumns=False) const |
Show the structure of a table. More... | |
Table & | table () |
Return the table object. More... | |
const Table & | table () const |
Static Public Member Functions | |
static Record | getTableDesc (const TableDesc &tabdesc, Bool cOrder=False) |
Create a Record table description from a TableDesc object. More... | |
static Record | getKeyValues (const TableRecord &keySet) |
Get or put the values of all keywords. More... | |
static void | putKeyValues (TableRecord &keySet, const Record &valueSet) |
static TableLock | makeLockOptions (const Record &options) |
Get the lock options from the fields in the record. More... | |
static Table::EndianFormat | makeEndianFormat (const String &endianFormat) |
Turn the string into the endian format option. More... | |
static Bool | makeHC (const Record &gdesc, TableDesc &tabdesc, String &message) |
Make hypercolumn definitions for the given hypercolumns. More... | |
static ValueHolder | getKeyValue (const TableRecord &keySet, const RecordFieldId &fieldId) |
Get the value of a keyword. More... | |
static void | putKeyValue (TableRecord &keySet, const RecordFieldId &fieldId, const ValueHolder &value) |
Put the value of a keyword. More... | |
static Bool | makeTableDesc (const Record &gdesc, TableDesc &tabdesc, String &message) |
Make a real table description from a table description in a record. More... | |
static Bool | addArrayColumnDesc (TableDesc &tableDesc, const String &valueType, const String &columnName, const String &comment, const String &dataManagerType, const String &dataManagerGroup, int options, Int ndim, const Vector< Int > &shape, Bool cOrder, String &message) |
Add an array column description to the table description. More... | |
static Record | recordColumnDesc (const ColumnDesc &, Bool cOrder) |
Make a record containing the column description. More... | |
static Record | recordHCDesc (const TableDesc &tableDesc) |
Make a record containing the description of all hypercolumns. More... | |
static void | calcValues (Record &rec, const TableExprNode &expr) |
Calculate the values of a CALC expression and store them in field 'values' in rec. More... | |
static String | getTypeStr (DataType) |
Get the type string as used externally (in e.g. More... | |
static IPosition | fillAxes (const IPosition &, Bool cOrder) |
Optionally reverse the axes. More... | |
static void | stillSameShape (Int &same, IPosition &shape, const IPosition &newShape) |
Check if the new shape is still the same. More... | |
template<typename T > | |
static Array< T > | record2Array (const Record &rec) |
Copy the array contents of the record fields to a single array. More... | |
Private Member Functions | |
Bool | getColInfo (const String &colName, Bool useBrackets, String &type, String &message) |
Get the column info for toAscii. More... | |
void | printValueHolder (const ValueHolder &vh, ostream &os, const String &sep, Int prec, Bool useBrackets) const |
Print the data in a table cell for toAscii. More... | |
template<typename T > | |
void | printArray (const Array< T > &arr, ostream &os, const String &sep) const |
void | printArrayValue (ostream &os, Bool v, const String &) const |
void | printArrayValue (ostream &os, Int v, const String &) const |
void | printArrayValue (ostream &os, Int64 v, const String &) const |
void | printArrayValue (ostream &os, Double v, const String &) const |
void | printArrayValue (ostream &os, const DComplex &v, const String &) const |
void | printArrayValue (ostream &os, const String &v, const String &) const |
Int64 | getRowsCheck (const String &columnName, Int64 row, Int64 nrow, Int64 incr, const String &caller) |
Sync table to get correct nr of rows and check the row number. More... | |
Int64 | getRowsSliceCheck (Slicer &slicer, const String &columnName, Int64 row, Int64 nrow, Int64 incr, const IPosition &blc, const IPosition &trc, const IPosition &inc, const String &caller) |
Sync table to get correct nr of rows and check the row number. More... | |
Int | checkRowColumn (Table &table, const String &colName, Int64 rownr, Int64 nrow, Int64 incr, const String &caller) |
Check if the column name and row numbers are valid. More... | |
ValueHolder | getValueFromTable (const String &colName, Int rownr, Int nrow, Int incr, Bool isCell) |
Get values from the column. More... | |
void | getValueFromTable (const String &colName, Int rownr, Int nrow, Int incr, Bool isCell, const ValueHolder &vh) |
ValueHolder | getValueSliceFromTable (const String &colName, const Slicer &slicer, Int rownr, Int nrow, Int incr, Bool isCell) |
Get value slices from the column. More... | |
void | getValueSliceFromTable (const String &colName, const Slicer &slicer, Int rownr, Int nrow, Int incr, Bool isCell, const ValueHolder &vh) |
void | putValueInTable (const String &colName, Int rownr, Int nrow, Int incr, Bool isCell, const ValueHolder &) |
Put values into the column. More... | |
void | putValueSliceInTable (const String &colName, const Slicer &slicer, Int rownr, Int nrow, Int incr, Bool isCell, const ValueHolder &) |
Put value slices into the column. More... | |
void | findKeyId (RecordFieldId &fieldid, const TableRecord *&keySet, const String &keyname, const String &column) |
Split the keyname into its separate parts (separator is .). More... | |
void | findKeyId (RecordFieldId &fieldid, TableRecord *&keySet, const String &keyname, const String &column, Bool mustExist, Bool change, Bool makeSubRecord) |
void | setDefaultForSlicer (IPosition &vec) const |
Replace the user-given default value (<0) by the default value used by Slicer (i.e. More... | |
void | syncTable (Table &table) |
Synchronize table if readlocking is in effect. More... | |
Private Attributes | |
Table | table_p |
String | asciiFormat_p |
Record | calcResult_p |
High-level interface to tables.
Public interface
TableProxy is a proxy for access to tables from any script.
TableProxy gives access to most of the functionality in the Table System. It is primarily meant to be used in classes that wrap access to it from scripting languages (like Glish and Python). However, it can also be used directly from other C++ code.
It has functions to open, create, read, write, and query tables. Accompying proxy classes give access to other functionality. They are:
TableProxy does not have the TableRecord type in its interface, because such a type cannot be handled by e.g. Glish or Python. Instead it converts TableRecords to/from Records. If a TableRecord contains a field with a Table object, it is represented in the Record as a string with the value "Table: NAME" where NAME is the table name.
TableProxy is the Tasking-independent high-level table interface. Different front-ends (e.g. GlishTableProxy) can be put on top of it.
Definition at line 103 of file TableProxy.h.
casacore::TableProxy::TableProxy | ( | ) |
Default constructor initializes to not open.
This constructor is only needed for containers.
Referenced by TableProxy().
|
inline |
Create the object from an existing table (used by some methods).
Definition at line 111 of file TableProxy.h.
References addColumns(), addReadmeLine(), addRow(), cellContentsDefined(), close(), columnArrayType(), columnDataType(), columnNames(), copy(), copyRows(), deleteTable(), endianFormat(), casacore::False, flush(), getAsciiFormat(), getCalcResult(), getCell(), getCellSlice(), getCellSliceIP(), getCellSliceVH(), getCellSliceVHIP(), getCellVH(), getColumn(), getColumnDescription(), getColumnShapeString(), getColumnSlice(), getColumnSliceIP(), getColumnSliceVH(), getColumnSliceVHIP(), getColumnVH(), getDataManagerInfo(), getFieldNames(), getKeyword(), getKeywordSet(), getPartNames(), getProperties(), getTableDesc(), getTableDescription(), getVarColumn(), hasDataChanged(), hasLock(), isMultiUsed(), isReadable(), isScalarColumn(), isWritable(), lock(), lockOptions(), ncolumns(), nrows(), operator=(), putCell(), putCellSlice(), putCellSliceIP(), putColumn(), putColumnSlice(), putColumnSliceIP(), putKeyword(), putKeywordSet(), putTableInfo(), putVarColumn(), removeColumns(), removeKeyword(), removeRow(), rename(), renameColumn(), reopenRW(), resync(), rowNumbers(), selectRows(), setMaximumCacheSize(), setProperties(), shape(), showStructure(), tableInfo(), tableName(), TableProxy(), toAscii(), casacore::True, unlock(), casacore::value(), and ~TableProxy().
casacore::TableProxy::TableProxy | ( | const String & | tableName, |
const Record & | lockOptions, | ||
int | option | ||
) |
Open the table with a given name.
casacore::TableProxy::TableProxy | ( | const String & | tableName, |
const Record & | lockOptions, | ||
const String & | endianFormat, | ||
const String & | memType, | ||
int | nrow, | ||
const Record & | tableDesc, | ||
const Record & | dmInfo | ||
) |
Create a table with given name and description, etc.
casacore::TableProxy::TableProxy | ( | const Vector< String > & | tableNames, |
const Vector< String > & | concatenateSubTableNames, | ||
const Record & | lockOptions, | ||
int | option | ||
) |
Create a table object to concatenate a number of similar tables.
The keyword set of the first table is take as the keyword set of the entire concatenation. However, it can be specified which subtables have to be concatenated as well which means that for each subtable name the subtable in the keywordsets are concatenated.
Note: For Boost-Python the constructors must have different nr of arguments; Hence some dummy arguments are added;
casacore::TableProxy::TableProxy | ( | const std::vector< TableProxy > & | tables, |
const Vector< String > & | concatenateSubTableNames, | ||
int | dummy1 = 0 , |
||
int | dummy2 = 0 , |
||
int | dummy3 = 0 |
||
) |
casacore::TableProxy::TableProxy | ( | const String & | command, |
const std::vector< TableProxy > & | tables | ||
) |
Create a table object from a table command (as defined in TableGram).
If a CALC command was given, the resulting values are stored in the a record and a null TableProxy object is returned. The result can be obtained using getCalcResult.
Note: If the command string contains no GIVING part, the resulting table is temporary and its name is blank;
casacore::TableProxy::TableProxy | ( | const String & | fileName, |
const String & | headerName, | ||
const String & | tableName, | ||
Bool | autoHeader, | ||
const IPosition & | autoShape, | ||
const String & | separator, | ||
const String & | commentMarker, | ||
Int | firstLine, | ||
Int | lastLine, | ||
const Vector< String > & | columnNames = Vector< String >() , |
||
const Vector< String > & | dataTypes = Vector< String >() |
||
) |
Create a table from an Ascii file.
It fills a string containing the names and types of the columns (in the form COL1=R, COL2=D, ...). The string can be obtained using getAsciiFormat.
casacore::TableProxy::TableProxy | ( | const TableProxy & | ) |
Copy constructor.
casacore::TableProxy::~TableProxy | ( | ) |
Close the table.
Referenced by TableProxy().
|
static |
Add an array column description to the table description.
It is used by the function makeDesc.
Referenced by table().
void casacore::TableProxy::addColumns | ( | const Record & | tableDesc, |
const Record & | dminfo, | ||
Bool | addToParent | ||
) |
Add one or more columns to the table.
Referenced by TableProxy().
void casacore::TableProxy::addReadmeLine | ( | const String & | line | ) |
Add a line to the TableInfo readme.
Referenced by TableProxy().
void casacore::TableProxy::addRow | ( | Int | nrow | ) |
Add rows to the table.
Referenced by TableProxy().
|
static |
Calculate the values of a CALC expression and store them in field 'values' in rec.
Referenced by table().
Tests if the contents of a cell are defined.
Only a column with variable shaped arrays can have an empty cell.
Referenced by TableProxy().
|
private |
Check if the column name and row numbers are valid.
Return the recalculated nrow so that it does not exceed #rows.
Referenced by printArrayValue().
void casacore::TableProxy::close | ( | ) |
Flush and close the table and all its subtables.
Referenced by TableProxy().
Return the type of array in the column as: Direct Undefined FixedShape Direct,Undefined Direct,FixedShape Undefined,FixedShape Direct,Undefined,FixedShape or Error – unexpected column type.
Referenced by TableProxy().
Return the data type of the column as: Bool, UChar, Short, UShort, Int, UInt, Float, Double, Complex, DComplex, String, Table, or unknown.
Referenced by TableProxy().
Get all column names in the table.
Referenced by TableProxy().
TableProxy casacore::TableProxy::copy | ( | const String & | newTableName, |
Bool | toMemoryTable, | ||
Bool | deepCopy, | ||
Bool | valueCopy, | ||
const String & | endianFormat, | ||
const Record & | dminfo, | ||
Bool | noRows | ||
) |
Copy the table (possibly a deep copy).
If noRows=True, an empty table is created.
Referenced by TableProxy().
void casacore::TableProxy::copyRows | ( | TableProxy & | out, |
Int | startIn, | ||
Int | startOut, | ||
Int | nrow | ||
) |
Copy rows from one table to another.
If startOut<0, it is set to the end of the output table.
Referenced by TableProxy().
void casacore::TableProxy::deleteTable | ( | Bool | checkSubTables | ) |
Close and delete the table.
Referenced by TableProxy().
String casacore::TableProxy::endianFormat | ( | ) | const |
Get the endian format of the table.
It fills the result with value "big" or "little".
Referenced by TableProxy().
Optionally reverse the axes.
Referenced by table().
|
private |
Split the keyname into its separate parts (separator is .).
Check if each part exists and is a subrecord (except last part). When putting, subrecords are created if undefined and if makeSubRecord is set. On return it fills in the fieldid with the latest keyword part. KeySet is set to the last subrecord.
Referenced by printArrayValue().
|
private |
void casacore::TableProxy::flush | ( | Bool | recursive | ) |
Flush the table and optionally all its subtables.
Referenced by TableProxy().
String casacore::TableProxy::getAsciiFormat | ( | ) | const |
Get ascii format string.
Referenced by TableProxy().
Record casacore::TableProxy::getCalcResult | ( | ) | const |
Get result of possible CALC statement.
Referenced by TableProxy().
ValueHolder casacore::TableProxy::getCell | ( | const String & | columnName, |
Int | row | ||
) |
Get a value from a column in the table.
Referenced by TableProxy().
ValueHolder casacore::TableProxy::getCellSlice | ( | const String & | columnName, |
Int | row, | ||
const Vector< Int > & | blc, | ||
const Vector< Int > & | trc, | ||
const Vector< Int > & | inc | ||
) |
Get a value slice from a column in the table.
If the inc vector is empty, it defaults to all 1.
Referenced by TableProxy().
ValueHolder casacore::TableProxy::getCellSliceIP | ( | const String & | columnName, |
Int | row, | ||
const IPosition & | blc, | ||
const IPosition & | trc, | ||
const IPosition & | inc | ||
) |
Referenced by TableProxy().
void casacore::TableProxy::getCellSliceVH | ( | const String & | columnName, |
Int | row, | ||
const Vector< Int > & | blc, | ||
const Vector< Int > & | trc, | ||
const Vector< Int > & | inc, | ||
const ValueHolder & | vh | ||
) |
Referenced by TableProxy().
void casacore::TableProxy::getCellSliceVHIP | ( | const String & | columnName, |
Int | row, | ||
const IPosition & | blc, | ||
const IPosition & | trc, | ||
const IPosition & | inc, | ||
const ValueHolder & | vh | ||
) |
Referenced by TableProxy().
void casacore::TableProxy::getCellVH | ( | const String & | columnName, |
Int | row, | ||
const ValueHolder & | vh | ||
) |
Referenced by TableProxy().
|
private |
Get the column info for toAscii.
Referenced by record2Array().
ValueHolder casacore::TableProxy::getColumn | ( | const String & | columnName, |
Int | row, | ||
Int | nrow, | ||
Int | incr | ||
) |
Get some or all values from a column in the table.
row is the starting row number (0-relative). nrow=-1 means until the end of the table. incr is the step in row number.
Referenced by TableProxy().
Record casacore::TableProxy::getColumnDescription | ( | const String & | columnName, |
Bool | actual, | ||
Bool | cOrder = False |
||
) |
Get the column description of a column in the table.
It returns a record containing the description.
Referenced by TableProxy().
Vector<String> casacore::TableProxy::getColumnShapeString | ( | const String & | columnName, |
Int | rownr, | ||
Int | nrow, | ||
Int | incr, | ||
Bool | cOrder = False |
||
) |
Get the shape of one or more cells in a column as a vector of Strings containing the shapes as [a,b,c].
If the shape is fixed, a single String is returned.
Referenced by TableProxy().
ValueHolder casacore::TableProxy::getColumnSlice | ( | const String & | columnName, |
Int | row, | ||
Int | nrow, | ||
Int | incr, | ||
const Vector< Int > & | blc, | ||
const Vector< Int > & | trc, | ||
const Vector< Int > & | inc | ||
) |
Get some or all value slices from a column in the table.
If the inc vector is empty, it defaults to all 1.
Referenced by TableProxy().
ValueHolder casacore::TableProxy::getColumnSliceIP | ( | const String & | columnName, |
const IPosition & | blc, | ||
const IPosition & | trc, | ||
const IPosition & | inc, | ||
Int | row, | ||
Int | nrow, | ||
Int | incr | ||
) |
Referenced by TableProxy().
void casacore::TableProxy::getColumnSliceVH | ( | const String & | columnName, |
Int | row, | ||
Int | nrow, | ||
Int | incr, | ||
const Vector< Int > & | blc, | ||
const Vector< Int > & | trc, | ||
const Vector< Int > & | inc, | ||
const ValueHolder & | vh | ||
) |
Referenced by TableProxy().
void casacore::TableProxy::getColumnSliceVHIP | ( | const String & | columnName, |
const IPosition & | blc, | ||
const IPosition & | trc, | ||
const IPosition & | inc, | ||
Int | row, | ||
Int | nrow, | ||
Int | incr, | ||
const ValueHolder & | vh | ||
) |
Referenced by TableProxy().
void casacore::TableProxy::getColumnVH | ( | const String & | columnName, |
Int | row, | ||
Int | nrow, | ||
Int | incr, | ||
const ValueHolder & | vh | ||
) |
Referenced by TableProxy().
Record casacore::TableProxy::getDataManagerInfo | ( | ) |
Get the data manager info of the table.
Referenced by TableProxy().
Vector<String> casacore::TableProxy::getFieldNames | ( | const String & | columnName, |
const String & | keywordName, | ||
Int | keywordIndex | ||
) |
Get the names of all field in a record in the table.
If the column name is empty, the table keywords are used. If the keyword name is empty, the names of all keywords are returned. Otherwise the names of all fields in the keyword value are returned. In that case the value has to be a record.
Referenced by TableProxy().
|
static |
Get the value of a keyword.
Referenced by table().
|
static |
Get or put the values of all keywords.
Thus convert from TableRecord to/from Record. Keywords containing a table are converted to a string containing the table name preceeded by 'Table: '.
Referenced by table().
ValueHolder casacore::TableProxy::getKeyword | ( | const String & | columnName, |
const String & | keywordName, | ||
Int | keywordIndex | ||
) |
Get a table or column keyword value in the table.
If the columnName is empty, a given keyword is a table keyword. The keyword can be given as a name or a 0-based index.
Referenced by TableProxy().
Get the table or column keyword values in the table.
If the columnName is empty, the table keyword values are returned.
Referenced by TableProxy().
Get the names of the parts the table consists of (e.g.
for a ConcatTable).
Referenced by TableProxy().
Get the properties of a data manager given by column or data manager name.
Referenced by TableProxy().
|
private |
Sync table to get correct nr of rows and check the row number.
It returns the nr of table rows.
Referenced by printArrayValue().
|
private |
Sync table to get correct nr of rows and check the row number.
Fill the slicer with the possibly expanded blc,trc,inc. It returns the nr of table rows.
Referenced by printArrayValue().
|
static |
Create a Record table description from a TableDesc object.
Referenced by TableProxy().
Get the table description of the table.
It returns a record containing the description.
Referenced by TableProxy().
|
static |
|
private |
Get values from the column.
Nrow<0 means till the end of the column.
Referenced by printArrayValue().
|
private |
|
private |
Get value slices from the column.
Nrow<0 means till the end of the column.
Referenced by printArrayValue().
|
private |
Record casacore::TableProxy::getVarColumn | ( | const String & | columnName, |
Int | row, | ||
Int | nrow, | ||
Int | incr | ||
) |
Referenced by TableProxy().
Bool casacore::TableProxy::hasDataChanged | ( | ) |
Determine if data in the table has changed.
Referenced by TableProxy().
Determine if the process has a read or write lock on the table.
Referenced by TableProxy().
Determine if the table (and optionally its subtables) are in use in another process.
Referenced by TableProxy().
Bool casacore::TableProxy::isReadable | ( | ) | const |
Test if a table is readable.
Referenced by TableProxy().
Return in result if the column contains scalars.
Referenced by TableProxy().
Bool casacore::TableProxy::isWritable | ( | ) | const |
Test if a table is writable.
Referenced by TableProxy().
Acquire a (read or write) lock on the table.
Referenced by TableProxy().
Record casacore::TableProxy::lockOptions | ( | ) |
Get the lock options of the table.
It fills the record with the fields option, interval and maxwait.
Referenced by TableProxy().
|
static |
Turn the string into the endian format option.
An exception is thrown if the string is invalid.
Referenced by table().
|
static |
Make hypercolumn definitions for the given hypercolumns.
Referenced by table().
Get the lock options from the fields in the record.
If the record or lockoption is invalid, an exception is thrown.
Referenced by table().
Int casacore::TableProxy::ncolumns | ( | ) |
Get #columns of the table.
Referenced by TableProxy().
Int casacore::TableProxy::nrows | ( | ) |
Get #rows of the table.
Referenced by TableProxy().
TableProxy& casacore::TableProxy::operator= | ( | const TableProxy & | ) |
Assignment.
Referenced by TableProxy().
|
private |
Referenced by record2Array().
|
inlineprivate |
Definition at line 703 of file TableProxy.h.
|
inlineprivate |
Definition at line 705 of file TableProxy.h.
|
inlineprivate |
Definition at line 707 of file TableProxy.h.
|
inlineprivate |
Definition at line 709 of file TableProxy.h.
|
inlineprivate |
Definition at line 711 of file TableProxy.h.
|
inlineprivate |
Definition at line 713 of file TableProxy.h.
References checkRowColumn(), findKeyId(), getRowsCheck(), getRowsSliceCheck(), getValueFromTable(), getValueSliceFromTable(), putValueInTable(), putValueSliceInTable(), setDefaultForSlicer(), syncTable(), and table().
|
private |
Print the data in a table cell for toAscii.
Referenced by record2Array().
void casacore::TableProxy::putCell | ( | const String & | columnName, |
const Vector< Int > & | rownrs, | ||
const ValueHolder & | |||
) |
Put a value into a column in the table.
Referenced by TableProxy().
void casacore::TableProxy::putCellSlice | ( | const String & | columnName, |
Int | row, | ||
const Vector< Int > & | blc, | ||
const Vector< Int > & | trc, | ||
const Vector< Int > & | inc, | ||
const ValueHolder & | |||
) |
Put a value slice into a column in the table.
If the inc vector is empty, it defaults to all 1.
Referenced by TableProxy().
void casacore::TableProxy::putCellSliceIP | ( | const String & | columnName, |
Int | row, | ||
const ValueHolder & | , | ||
const IPosition & | blc, | ||
const IPosition & | trc, | ||
const IPosition & | inc | ||
) |
Referenced by TableProxy().
void casacore::TableProxy::putColumn | ( | const String & | columnName, |
Int | row, | ||
Int | nrow, | ||
Int | incr, | ||
const ValueHolder & | |||
) |
Put some or all values into a column in the table.
row is the starting row number (0-relative). nrow=-1 means until the end of the table. incr is the step in row number.
Referenced by TableProxy().
void casacore::TableProxy::putColumnSlice | ( | const String & | columnName, |
Int | row, | ||
Int | nrow, | ||
Int | incr, | ||
const Vector< Int > & | blc, | ||
const Vector< Int > & | trc, | ||
const Vector< Int > & | inc, | ||
const ValueHolder & | |||
) |
Put some or all value slices into a column in the table.
Referenced by TableProxy().
void casacore::TableProxy::putColumnSliceIP | ( | const String & | columnName, |
const ValueHolder & | , | ||
const IPosition & | blc, | ||
const IPosition & | trc, | ||
const IPosition & | inc, | ||
Int | row, | ||
Int | nrow, | ||
Int | incr | ||
) |
Referenced by TableProxy().
|
static |
Put the value of a keyword.
Referenced by table().
|
static |
Referenced by table().
void casacore::TableProxy::putKeyword | ( | const String & | columnName, |
const String & | keywordName, | ||
Int | keywordIndex, | ||
Bool | makeSubRecord, | ||
const ValueHolder & | |||
) |
Define a table or column keyword in the table.
If the column name is empty, a table keyword is defined. The keyword can be given as a name or a 0-based number. The value should be a record containing the value of the keyword. The value can be any type (including a record).
Referenced by TableProxy().
Define multiple table or column keywords in the table.
If the column name is empty, a table keywords are defined. The value should be a record containing the values of the keywords. The values can be any type (including a record). The field names are the keyword names.
Referenced by TableProxy().
void casacore::TableProxy::putTableInfo | ( | const Record & | value | ) |
Put the table info of the table.
Referenced by TableProxy().
|
private |
Put values into the column.
Nrow<0 means till the end of the column.
Referenced by printArrayValue().
|
private |
Put value slices into the column.
Nrow<0 means till the end of the column.
Referenced by printArrayValue().
void casacore::TableProxy::putVarColumn | ( | const String & | columnName, |
Int | row, | ||
Int | nrow, | ||
Int | incr, | ||
const Record & | values | ||
) |
Referenced by TableProxy().
|
inlinestatic |
Copy the array contents of the record fields to a single array.
This can only be done if the shape is constant.
Definition at line 673 of file TableProxy.h.
References casacore::IPosition::append(), casacore::RecordInterface::empty(), casacore::RecordInterface::get(), getColInfo(), casacore::ArrayBase::ndim(), printArray(), printValueHolder(), casacore::ArrayBase::shape(), and casacore::RecordInterface::size().
|
static |
Make a record containing the column description.
Referenced by table().
Make a record containing the description of all hypercolumns.
Referenced by table().
Remove one or more columns from the table.
Referenced by TableProxy().
void casacore::TableProxy::removeKeyword | ( | const String & | columnName, |
const String & | keywordName, | ||
Int | keywordIndex | ||
) |
Remove a table or column keyword from the table.
If the column name is empty, a table keyword is removed.
Referenced by TableProxy().
Remove rows from the table.
Referenced by TableProxy().
void casacore::TableProxy::rename | ( | const String & | newTableName | ) |
Rename the table.
Referenced by TableProxy().
Rename a column in the table.
Referenced by TableProxy().
void casacore::TableProxy::reopenRW | ( | ) |
Reopen the table for read/write.
Referenced by TableProxy().
void casacore::TableProxy::resync | ( | ) |
Resync the table.
Referenced by TableProxy().
Vector<Int> casacore::TableProxy::rowNumbers | ( | TableProxy & | other | ) |
Get the row numbers of the table.
Referenced by TableProxy().
TableProxy casacore::TableProxy::selectRows | ( | const Vector< Int > & | rownrs, |
const String & | outName | ||
) |
Select the given rows from the table and create a new (reference) table.
If outName is not empty, the new table is made persistent with that name.
Referenced by TableProxy().
|
private |
Replace the user-given default value (<0) by the default value used by Slicer (i.e.
by Slicer::MimicSource).
Referenced by printArrayValue().
Set the maximum cache size for the given column in the table.
Referenced by TableProxy().
void casacore::TableProxy::setProperties | ( | const String & | name, |
Bool | byColumn, | ||
const Record & | properties | ||
) |
Set the properties of a data manager given by column or data manager name.
Referenced by TableProxy().
Get the shape (#columns, #rows) of the table.
Referenced by TableProxy().
String casacore::TableProxy::showStructure | ( | Bool | showDataMan = True , |
Bool | showColumns = True , |
||
Bool | showSubTables = False , |
||
Bool | sortColumns = False |
||
) | const |
Show the structure of a table.
Referenced by TableProxy().
|
static |
Check if the new shape is still the same.
same: 0=first time; 1=still the same; 2=different
Referenced by table().
|
private |
Synchronize table if readlocking is in effect.
In this way the number of rows is up-to-date.
Referenced by printArrayValue().
|
inline |
Return the table object.
Definition at line 593 of file TableProxy.h.
References table_p.
Referenced by casacore::ImageAttrGroupCasa::isNull(), and printArrayValue().
|
inline |
Definition at line 595 of file TableProxy.h.
References addArrayColumnDesc(), calcValues(), fillAxes(), getKeyValue(), getKeyValues(), getTypeStr(), makeEndianFormat(), makeHC(), makeLockOptions(), makeTableDesc(), casacore::ndim(), putKeyValue(), putKeyValues(), recordColumnDesc(), recordHCDesc(), stillSameShape(), and table_p.
Record casacore::TableProxy::tableInfo | ( | ) |
Get the table info of the table.
Referenced by TableProxy().
String casacore::TableProxy::tableName | ( | ) |
Get table name.
Referenced by TableProxy().
String casacore::TableProxy::toAscii | ( | const String & | asciiFile, |
const String & | headerFile, | ||
const Vector< String > & | columns, | ||
const String & | sep, | ||
const Vector< Int > & | precision, | ||
Bool | useBrackets | ||
) |
Write the table to an ASCII file (approximately the inverse of the from-ASCII-contructor).
If headerFile
is empty or equal to asciiFile
, the headers are written in the same file as the data, otherwise in a separate file. If no columns are given (or if the first column name is empty), all table columns are written. Columns containing records are also printed (enclosed in {}), but a warning message is returned.
Argument sep
is used as separator between columns and array values. If it is empty, a blank is used.
For each column the precision can be given. It is only used for columns containing floating point numbers. A value <=0 means using the default which is 9 for single and 18 for double precision.
If useBrackets=True
, arrays are enclosed in [] (for each dimension), so variable shaped arrays can be read back unambiguously. The type in the header will be something like D[4,64]. If the column is variable shaped, the type is like D[]. If useBracket=False
, arrays are written linearly where a shape [4,64] is given in the header like D4,64. If the column is variable shaped, the shape of the first cell is used and a warning message is returned.
Referenced by TableProxy().
void casacore::TableProxy::unlock | ( | ) |
Release a lock on the table.
Referenced by TableProxy().
|
private |
Definition at line 802 of file TableProxy.h.
|
private |
Definition at line 803 of file TableProxy.h.
|
private |
Definition at line 801 of file TableProxy.h.
Referenced by table().