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;
325 const Slicer& arraySection)
const;
330 const Slicer& arraySection)
const;
372 {
put (rownr, that, rownr, preserveTileShape); }
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
Specify which elements to extract from an n-dimensional array.
A Vector of integers, for indexing into Array<T> objects.
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
virtual void put(uInt rownr, const void *dataPtr)=0
Put the value in a particular cell.
Bool empty() const
Test for empty.
virtual uInt ndim(uInt rownr) const
Get the #dimensions of an array in a particular cell.
Read/write access to a table 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 put(uInt rownr, const Array< T > &array)
Put the array in a particular cell (i.e.
String validateParameters()
void reference(const ArrayColumn< T > &)
Change the reference to another column.
const IPosition & shape() const
Accessor that returns the shape.
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...
Read and write access to an array table column with arbitrary data type.
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)
BaseColumn * baseColPtr_p
Array< T > getColumn() const
void baseGet(uInt rownr, Array< T > &array) const
The get() function like above which does not check shapes, etc.
void get(uInt rownr, Array< T > &array, Bool resize=False) const
Get the array value in a particular cell (i.e.
Main interface class to a read/write table.
void checkShape(const IPosition &shp, Array< T > &arr, Bool resize, const String &where) const
Check the shape of the array.
IPosition tileShape(uInt rownr) const
Get the tile shape of an array in a particular cell.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
ArrayColumn()
The default constructor creates a null object, i.e.
Class holding the row numbers in a RefTable.
Bool reaskAccessSlice_p
Keep switches to know if access knowledge is permanent or has to be asked again the next time.
~ColumnSlicer()
Kill off the Slicer objects.
void putSliceFromRows(const RefRows &rows, const Vector< Vector< Slice > > &arraySlices, const Array< T > &source)
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.
define a (start,length,increment) along an axis
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.
Abstract baseclass for slices functors.
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.
Table table() const
Get the Table object this column belongs to.
uInt ndim(uInt rownr) const
Get the #dimensions of an array in a particular cell.
virtual IPosition shape(uInt rownr) const
Get the shape of an array in a particular cell.
void basePut(uInt rownr, const Array< T > &array)
The put() function like above which does not check shapes, etc.
void putColumnCells(const RefRows &rownrs, const Array< T > &arr)
Vector< Slicer * > dataSlicers_p
template <class T, class U> class vector;
virtual void get(uInt rownr, void *dataPtr) const =0
Get the value from a particular cell.
String: the storage and methods of handling collections of characters.
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.
Bool canAccessColumnSlice_p
A 1-D Specialization of the Array class.
Bool reaskAccessColumnSlice_p
const Vector< Slicer * > & getDestinationSlicers() const
Accessor that returns the desintation slicers.
Base class for all Casacore library errors.
Vector< Slicer * > destinationSlicers_p
void checkDataType() const
Check if the data type matches the column data type.
virtual TableColumn * clone() const
Clone the object.