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;
370 {
put (rownr, that, rownr); }
383 {
put (rownr, that, rownr); }
482 const String& where)
const;
525 : dataSlicers_p (dataSlicers),
526 destinationSlicers_p (destinationSlicers),
529 String message = validateParameters ();
530 if (! message.
empty()){
549 return dataSlicers_p;
556 return destinationSlicers_p;
574 for (
uInt i = 0; i < dataSlicers_p.size(); i++){
575 delete dataSlicers_p [i];
578 for (
uInt i = 0; i < destinationSlicers_p.size(); i++){
579 delete destinationSlicers_p [i];
587 if (dataSlicers_p.size() != destinationSlicers_p.size()){
588 return String::format (
"Number of data slicers (%d) and destination slicers (%d) " 589 "must match", dataSlicers_p.size(), destinationSlicers_p.size());
592 if (dataSlicers_p.size() == 0){
593 return String::format (
"At least one destination and one data slicer required.");
596 for (
uInt i = 0; i < dataSlicers_p.size(); i++){
598 if (dataSlicers_p[i]->
length() != destinationSlicers_p[i]->
length()){
601 "destination slicer [%d] (%s) must be equal",
636 #define ROArrayColumn ArrayColumn 639 #ifndef CASACORE_NO_AUTO_TEMPLATES 640 #include <casacore/tables/Tables/ArrayColumn.tcc> 641 #endif //# CASACORE_NO_AUTO_TEMPLATES A Vector of integers, for indexing into Array<T> objects.
virtual IPosition shape(uInt rownr) const
Get the shape of an array in a particular cell.
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.
A 1-D Specialization of the Array class.
#define TABLECOLUMNCHECKROW(ROWNR)
const Vector< Slicer * > & getDestinationSlicers() const
Accessor that returns the desintation slicers.
ArrayColumn< T > & operator=(const ArrayColumn< T > &)
Assignment uses reference semantics, thus works the same as function reference.
Array< T > getColumn() const
Main interface class to a read/write table.
void put(uInt rownr, const TableColumn &that)
Copy the value of a cell of that column to a cell of this column.
ColumnSlicer(const IPosition &shape, Vector< Slicer * > dataSlicers, Vector< Slicer * > destinationSlicers)
Create a ColumnSlicer for use in one of the overloads of ArrayColumn::getColumnCells.
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
void checkDataType() const
Check if the data type matches the column data type.
Vector< Slicer * > dataSlicers_p
void put(uInt rownr, const Array< T > &array)
Put the array in a particular cell (i.e.
IPosition shape(uInt rownr) const
Get the shape of an array in a particular cell.
void reference(const ArrayColumn< T > &)
Change the reference to another column.
void baseGet(uInt rownr, Array< T > &array) const
The get() function like above which does not check shapes, etc.
void putColumn(const Array< T > &array)
Put the array of all values in the column.
Bool canAccessSlice_p
Keep switches to determine if a slice or an entire column can be accessed or the change of an array c...
const Vector< Slicer * > & getDataSlicers() const
Accessor that returns the dataSlicers.
BaseColumn * baseColPtr_p
Vector< Slicer * > destinationSlicers_p
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.
Array< T > operator()(uInt rownr) const
~ColumnSlicer()
Kill off the Slicer objects.
define a (start,length,increment) along an axis
String validateParameters()
ArrayColumn()
The default constructor creates a null object, i.e.
void putSliceFromRows(const RefRows &rows, const Vector< Vector< Slice > > &arraySlices, const Array< T > &source)
Bool reaskAccessSlice_p
Keep switches to know if access knowledge is permanent or has to be asked again the next time...
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
Class holding the row numbers in a RefTable.
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)
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 putColumnRange(const Slicer &rowRange, const Array< T > &arr)
Put the array of some values in the column.
void fillColumn(const Array< T > &value)
Put the same value in all cells of the column.
bool Bool
Define the standard types used by Casacore.
void attach(const Table &table, const String &columnName)
Attach a column to the object.
Read and write access to an array table column with arbitrary data type.
Read/write access to a table column.
static String format(const char *picture,...)
Create a formatted string using the given printf format string.
void basePut(uInt rownr, const Array< T > &array)
The put() function like above which does not check shapes, etc.
void setShape(uInt rownr, const IPosition &shape)
Set the shape of the array in the given row.
friend LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
template <class T, class U> class vector;
void put(uInt rownr, const ArrayColumn< T > &that)
Copy the value of a cell of that column to a cell of this column.
void putColumnCells(const RefRows &rownrs, const Array< T > &arr)
void getColumnCells(const RefRows &rownrs, Array< T > &arr, Bool resize=False) const
Specify which elements to extract from an n-dimensional array.
Base class for all Casacore library errors.
virtual void get(uInt rownr, void *dataPtr) const =0
Get the value from a particular cell.
void getColumnRange(const Slicer &rowRange, Array< T > &arr, Bool resize=False) const
Get the array of some values in a column.
String: the storage and methods of handling collections of characters.
virtual TableColumn * clone() const
Clone the object.
Abstract baseclass for slices functors.
const IPosition & shape() const
Accessor that returns the shape.
Bool canAccessColumnSlice_p
void checkShape(const IPosition &shp, Array< T > &arr, Bool resize, const String &where) const
Check the shape of the array.
Bool reaskAccessColumnSlice_p
virtual void put(uInt rownr, const void *dataPtr)=0
Put the value in a particular cell.
this file contains all the compiler specific defines
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
Bool empty() const
Test for empty.
virtual uInt ndim(uInt rownr) const
Get the #dimensions of an array in a particular cell.