Go to the documentation of this file.
28 #ifndef TABLES_ARRAYCOLUMN_H
29 #define TABLES_ARRAYCOLUMN_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Arrays/Vector.h>
35 #include <casacore/tables/Tables/TableColumn.h>
36 #include <casacore/tables/Tables/TableError.h>
42 template<
class T>
class Array;
43 template<
class T>
class BaseSlicesFunctor;
325 const Slicer& arraySection)
const;
330 const Slicer& arraySection)
const;
345 { baseColPtr_p->get (rownr, &
array); }
372 {
put (rownr, that, rownr, preserveTileShape); }
461 { baseColPtr_p->put (rownr, &
array); }
472 const String& where)
const;
475 const char * where)
const;
523 if (! message.
empty()){
581 return String::format (
"Number of data slicers (%d) and destination slicers (%d) "
586 return String::format (
"At least one destination and one data slicer required.");
594 "destination slicer [%d] (%s) must be equal",
628 #define ROArrayColumn ArrayColumn
631 #ifndef CASACORE_NO_AUTO_TEMPLATES
632 #include <casacore/tables/Tables/ArrayColumn.tcc>
633 #endif //# CASACORE_NO_AUTO_TEMPLATES
void getSlice(uInt rownr, const Vector< Vector< Slice > > &arraySlices, Array< T > &arr, Bool resize=False) const
Get an irregular slice of an N-dimensional array in a particular cell (i.e.
void putColumnCells(const RefRows &rows, const Vector< Vector< Slice > > &arraySlices, const Array< T > &arr)
Same as putColumn(arraySlices, arr) except that it puts for the given rows instead of all rows.
Array< T > getColumnCells(const RefRows &rownrs, const Slicer &arraySection) const
IPosition shape(uInt rownr) const
Get the shape of an array in a particular cell.
void getColumnCells(const RefRows &rownrs, Array< T > &arr, Bool resize=False) const
Array< T > get(uInt rownr) const
ArrayColumn(const ArrayColumn< T > &)
Copy constructor (reference semantics).
Bool empty() const
Test for empty.
void putColumnRange(const Slicer &rowRange, const Slicer &arraySection, const Array< T > &arr)
Put into subsection of the table arrays in some rows of the column.
ArrayColumn< T > & operator=(const ArrayColumn< T > &)
Assignment uses reference semantics, thus works the same as function reference.
void getSlice(uInt rownr, const Slicer &arraySection, Array< T > &array, Bool resize=False) const
Get a slice of an N-dimensional array in a particular cell (i.e.
void putColumnCells(const RefRows &rownrs, const Slicer &arraySection, const Array< T > &arr)
void put(uInt rownr, const Array< T > &array)
Put the array in a particular cell (i.e.
String validateParameters()
void putColumnCells(const RefRows &rows, const ColumnSlicer &columnSlicer, const Array< T > &source)
Array< T > getSlice(uInt rownr, const Slicer &arraySection) const
void reference(const ArrayColumn< T > &)
Change the reference to another column.
const IPosition & shape() const
Accessor that returns the shape.
void putColumn(const Slicer &arraySection, const Array< T > &array)
Put into subsections of the table arrays in the entire column.
ArrayColumn(const Table &, const String &columnName)
Construct for the given column in the given table.
ColumnSlicer(const IPosition &shape, Vector< Slicer * > dataSlicers, Vector< Slicer * > destinationSlicers)
Create a ColumnSlicer for use in one of the overloads of ArrayColumn::getColumnCells.
void putColumn(const Array< T > &array)
Put the array of all values in the column.
Array< T > operator()(uInt rownr) const
Bool canAccessSlice_p
Keep switches to determine if a slice or an entire column can be accessed or the change of an array c...
Array< T > getColumnRange(const Slicer &rowRange) const
void handleSlices(const Vector< Vector< Slice > > &slices, BaseSlicesFunctor< T > &functor, const Slicer &slicer, IPosition &arrEnd, Array< T > &array) const
A common function used by all functions that can get or put irregular array slices.
String toString(const SubScanKey &subScanKey)
Array< T > getColumn() const
void baseGet(uInt rownr, Array< T > &array) const
The get() function like above which does not check shapes, etc.
void getColumnCells(const RefRows &rows, const ColumnSlicer &slicerSet, Array< T > &destination, Bool resize=False) const
Similar to getColumn (arraySlices, arr, resize) except it gets the slices for the given rows instead ...
void get(uInt rownr, Array< T > &array, Bool resize=False) const
Get the array value in a particular cell (i.e.
void checkShape(const IPosition &shp, Array< T > &arr, Bool resize, const String &where) const
Check the shape of the array.
void getColumnCells(const RefRows &rownrs, const Slicer &arraySection, Array< T > &arr, Bool resize=False) const
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
void getColumn(const Slicer &arraySection, Array< T > &array, Bool resize=False) const
Get regular slices from all arrays in the column.
ArrayColumn()
The default constructor creates a null object, i.e.
Bool reaskAccessSlice_p
Keep switches to know if access knowledge is permanent or has to be asked again the next time.
Array< T > getColumnCells(const RefRows &rownrs) const
~ColumnSlicer()
Kill off the Slicer objects.
void putSliceFromRows(const RefRows &rows, const Vector< Vector< Slice > > &arraySlices, const Array< T > &source)
Array< T > getColumnRange(const Slicer &rowRange, const Slicer &arraySection) const
void putColumn(const Vector< Vector< Slice > > &arraySlices, const Array< T > &arr)
void putSlice(uInt rownr, const Slicer &arraySection, const Array< T > &array)
Put into a slice of an N-dimensional array in a particular cell.
void attach(const Table &table, const String &columnName)
Attach a column to the object.
void putSlice(uInt rownr, const Vector< Vector< Slice > > &arraySlices, const Array< T > &arr)
void put(uInt rownr, const TableColumn &that, Bool preserveTileShape=False)
Copy the value of a cell of that column to a cell of this column.
void putColumnRange(const Slicer &rowRange, const Array< T > &arr)
Put the array of some values in the column.
void setShape(uInt rownr, const IPosition &shape)
Set the shape of the array in the given row.
void getColumn(Array< T > &array, Bool resize=False) const
Get the array of all values in a column.
this file contains all the compiler specific defines
const Vector< Slicer * > & getDataSlicers() const
Accessor that returns the dataSlicers.
void fillColumn(const Array< T > &value)
Put the same value in all cells of the column.
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
void getColumnRange(const Slicer &rowRange, Array< T > &arr, Bool resize=False) const
Get the array of some values in a column.
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
Array< T > getColumn(const Vector< Vector< Slice > > &arraySection) const
void checkShape(const IPosition &shp, Array< T > &arr, Bool resize, const char *where) const
uInt ndim(uInt rownr) const
Get the #dimensions of an array in a particular cell.
void put(uInt thisRownr, const TableColumn &that, uInt thatRownr, Bool preserveTileShape=False)
Use possibly different row numbers for that (i.e.
void basePut(uInt rownr, const Array< T > &array)
The put() function like above which does not check shapes, etc.
void putColumn(const ArrayColumn< T > &that)
Put the contents of a column with the same data type into this column.
void putColumnCells(const RefRows &rownrs, const Array< T > &arr)
Vector< Slicer * > dataSlicers_p
Array< T > getSlice(uInt rownr, const Vector< Vector< Slice > > &arraySlices) const
void getColumnRange(const Slicer &rowRange, const Slicer &arraySection, Array< T > &arr, Bool resize=False) const
Get slices from some arrays in a column.
template <class T, class U> class vector;
String: the storage and methods of handling collections of characters.
Array< T > getColumn(const Slicer &arraySection) const
void getColumn(const Vector< Vector< Slice > > &arraySection, Array< T > &array, Bool resize=False) const
Get irregular slices from all arrays in the column as given by the vectors of Slice objects.
bool Bool
Define the standard types used by Casacore.
#define TABLECOLUMNCHECKROW(ROWNR)
static String format(const char *picture,...)
Create a formatted string using the given printf format string.
ArrayColumn(const TableColumn &)
Construct from the given table column.
Bool canAccessColumnSlice_p
Bool reaskAccessColumnSlice_p
const Vector< Slicer * > & getDestinationSlicers() const
Accessor that returns the desintation slicers.
void setShape(uInt rownr, const IPosition &shape, const IPosition &tileShape)
Try to store the array in a tiled way using the given tile shape.
Vector< Slicer * > destinationSlicers_p
void checkDataType() const
Check if the data type matches the column data type.
virtual TableColumn * clone() const
Clone the object.