|
casacore
|
#include <StIndArray.h>
Public Member Functions | |
| StIndArray (Int64 fileOffset) | |
| Construct the object with the given file offset. | |
| StIndArray (const StIndArray &) | |
| Copy constructor. | |
| StIndArray & | operator= (const StIndArray &) |
| Assignment. | |
| ~StIndArray () | |
| const IPosition & | shape () const |
| Get the shape. | |
| Int64 | fileOffset () const |
| Get the file offset. | |
| Bool | setShape (StManArrayFile &, int dataType, const IPosition &shape) |
| Set the shape and allocate the array in the file. | |
| void | getShape (StManArrayFile &ios) |
| Read the shape if not read yet. | |
| uInt | refCount (StManArrayFile &ios) |
| Get the reference count. | |
| void | incrementRefCount (StManArrayFile &ios) |
| Increment the reference count. | |
| void | decrementRefCount (StManArrayFile &ios) |
| Decrement the reference count. | |
| void | copyData (StManArrayFile &ios, int dataType, const StIndArray &other) |
| Copy the data from another array. | |
| void | getArrayV (StManArrayFile &ios, ArrayBase &arr, DataType dtype) |
| Get an array value from the file at the offset held in this object. | |
| void | putArrayV (StManArrayFile &ios, const ArrayBase &arr, DataType dtype) |
| Put an array value into the file at the offset held in this object. | |
| void | getSliceV (StManArrayFile &, const Slicer &, ArrayBase &dataPtr, DataType dtype) |
| Get a section of the array from the file at the offset held in this object. | |
| void | putSliceV (StManArrayFile &, const Slicer &, const ArrayBase &dataPtr, DataType dtype) |
| Put a section of the array into the file at the offset held in this object. | |
Private Member Functions | |
| void | getSliceData (StManArrayFile &, const Slicer &ns, void *value, const IPosition &userArrayShape, void(*getVec)(StManArrayFile &, Int64, uInt64, uInt64, uInt64, uInt64, void *dataPtr)) |
| Get sliced data, i.e. | |
| void | putSliceData (StManArrayFile &, const Slicer &ns, const void *value, const IPosition &userArrayShape, void(*putVec)(StManArrayFile &, Int64, uInt64, uInt64, uInt64, uInt64, const void *dataPtr)) |
| Put sliced data, i.e. | |
| void | checkShape (const IPosition &userArrayShape, const IPosition &tableArrayShape) const |
| Throw an exception if the shape of the given array and the table array (slice) are not equal. | |
Static Private Member Functions | |
| static void | getVecBoolV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, void *value) |
| Get a (type-dependent) vector part of a slice. | |
| static void | getVecuCharV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, void *value) |
| static void | getVecShortV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, void *value) |
| static void | getVecuShortV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, void *value) |
| static void | getVecIntV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, void *value) |
| static void | getVecuIntV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, void *value) |
| static void | getVecInt64V (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, void *value) |
| static void | getVecfloatV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, void *value) |
| static void | getVecdoubleV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, void *value) |
| static void | getVecComplexV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, void *value) |
| static void | getVecDComplexV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, void *value) |
| static void | getVecStringV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, void *value) |
| template<typename T> | |
| static void | GetVectorGeneric (StManArrayFile &ios, Int64 fileOffset, uInt64 start, uInt64 leng, uInt64 inc, uInt64 valInx, void *value) |
| static void | putVecBoolV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, const void *value) |
| Put a (type-dependent) vector part of a slice. | |
| static void | putVecuCharV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, const void *value) |
| static void | putVecShortV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, const void *value) |
| static void | putVecuShortV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, const void *value) |
| static void | putVecIntV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, const void *value) |
| static void | putVecuIntV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, const void *value) |
| static void | putVecInt64V (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, const void *value) |
| static void | putVecfloatV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, const void *value) |
| static void | putVecdoubleV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, const void *value) |
| static void | putVecComplexV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, const void *value) |
| static void | putVecDComplexV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, const void *value) |
| static void | putVecStringV (StManArrayFile &ios, Int64 fileOffset, uInt64 arrayStart, uInt64 length, uInt64 increment, uInt64 valueIndex, const void *value) |
| template<typename T> | |
| static void | PutVectorGeneric (StManArrayFile &ios, Int64 fileOffset, uInt64 start, uInt64 leng, uInt64 inc, uInt64 valInx, const void *value) |
Private Attributes | |
| Int64 | fileOffset_p |
| uInt | arrOffset_p |
| IPosition | shape_p |
Read/write indirect arrays
Internal
StIndArray stores indirect arrays on behalf of a storage manager.
StIndArray is a helper class for accessing indirect table arrays. It is the interface between a storage manager like StManAipsIO (in particular its indirect array column class
StManColumnIndArrayAipsIO) and the data storage class StManArrayFile which represents the file holding the shapes and data of the arrays. This file holds the data in canonical format.
StIndArray holds information about an array in the file.
The storage manager creates an StIndArray object for each row. When an array is accessed for the first time, the array data offset and the shape will be filled in by StIndArray. In this way it serves as a cache for the array shape.
StIndArray implements all necessary functions to get/put an array or an array slice from/into file supplied by the given StManArrayFile object. The StManArrayFile object itself has to be created by the storage manager and given to the StIndArray functions.
This helper class makes it possible to share equal functionality between various storage managers handling indirect arrays. At the moment it is used by the StManAipsIO, IncrementalStMan, and StandardStMan storage managers, but it is not limited to them. It can equally well be used by any other storage manager storing (indirect) arrays via an StManArrayFile object.
Note that the following example is not really useful. StIndArray is an internal class and should not be used by a casual user. The example may however give a bit of insight.
Definition at line 138 of file StIndArray.h.
| casacore::StIndArray::StIndArray | ( | Int64 | fileOffset | ) |
Construct the object with the given file offset.
A zero file offset means that no array has been defined yet. That may be filled in later by setShape.
References fileOffset().
Referenced by copyData(), operator=(), and StIndArray().
| casacore::StIndArray::StIndArray | ( | const StIndArray & | ) |
Copy constructor.
References StIndArray().
| casacore::StIndArray::~StIndArray | ( | ) |
|
private |
Throw an exception if the shape of the given array and the table array (slice) are not equal.
| void casacore::StIndArray::copyData | ( | StManArrayFile & | ios, |
| int | dataType, | ||
| const StIndArray & | other ) |
Copy the data from another array.
An exception if thrown if the shapes do not match.
References casacore::dataType(), and StIndArray().
| void casacore::StIndArray::decrementRefCount | ( | StManArrayFile & | ios | ) |
Decrement the reference count.
|
inline |
Get the file offset.
Definition at line 157 of file StIndArray.h.
References fileOffset_p.
Referenced by getVecBoolV(), getVecComplexV(), getVecDComplexV(), getVecdoubleV(), getVecfloatV(), getVecInt64V(), getVecIntV(), getVecShortV(), getVecStringV(), GetVectorGeneric(), getVecuCharV(), getVecuIntV(), getVecuShortV(), putVecBoolV(), putVecComplexV(), putVecDComplexV(), putVecdoubleV(), putVecfloatV(), putVecInt64V(), putVecIntV(), putVecShortV(), putVecStringV(), PutVectorGeneric(), putVecuCharV(), putVecuIntV(), putVecuShortV(), and StIndArray().
| void casacore::StIndArray::getArrayV | ( | StManArrayFile & | ios, |
| ArrayBase & | arr, | ||
| DataType | dtype ) |
Get an array value from the file at the offset held in this object.
The buffer pointed to by dataPtr has to have the correct length (which is guaranteed by the ArrayColumn get function).
| void casacore::StIndArray::getShape | ( | StManArrayFile & | ios | ) |
Read the shape if not read yet.
|
private |
Get sliced data, i.e.
get a section of an array. This function is used by getSliceXXXV to have common functionality in one function. It calls the given getVec function for each chunk of data. In this way the bulk of type-independent code is concentrated in getSliceData resulting in small type-dependent functions.
References casacore::NewDelAllocator< T >::value.
| void casacore::StIndArray::getSliceV | ( | StManArrayFile & | , |
| const Slicer & | , | ||
| ArrayBase & | dataPtr, | ||
| DataType | dtype ) |
Get a section of the array from the file at the offset held in this object.
The buffer pointed to by dataPtr has to have the correct length (which is guaranteed by the ArrayColumn getSlice function).
|
inlinestaticprivate |
Get a (type-dependent) vector part of a slice.
This function is called for each chunk by putSliceData.
Definition at line 223 of file StIndArray.h.
References fileOffset(), GetVectorGeneric(), casacore::length(), and casacore::NewDelAllocator< T >::value.
|
inlinestaticprivate |
Definition at line 259 of file StIndArray.h.
References fileOffset(), GetVectorGeneric(), casacore::length(), and casacore::NewDelAllocator< T >::value.
|
inlinestaticprivate |
Definition at line 263 of file StIndArray.h.
References fileOffset(), GetVectorGeneric(), casacore::length(), and casacore::NewDelAllocator< T >::value.
|
inlinestaticprivate |
Definition at line 255 of file StIndArray.h.
References fileOffset(), GetVectorGeneric(), casacore::length(), and casacore::NewDelAllocator< T >::value.
|
inlinestaticprivate |
Definition at line 251 of file StIndArray.h.
References fileOffset(), GetVectorGeneric(), casacore::length(), and casacore::NewDelAllocator< T >::value.
|
inlinestaticprivate |
Definition at line 247 of file StIndArray.h.
References fileOffset(), GetVectorGeneric(), casacore::length(), and casacore::NewDelAllocator< T >::value.
|
inlinestaticprivate |
Definition at line 239 of file StIndArray.h.
References fileOffset(), GetVectorGeneric(), casacore::length(), and casacore::NewDelAllocator< T >::value.
|
inlinestaticprivate |
Definition at line 231 of file StIndArray.h.
References fileOffset(), GetVectorGeneric(), casacore::length(), and casacore::NewDelAllocator< T >::value.
|
inlinestaticprivate |
Definition at line 267 of file StIndArray.h.
References fileOffset(), GetVectorGeneric(), casacore::length(), and casacore::NewDelAllocator< T >::value.
|
inlinestaticprivate |
Definition at line 272 of file StIndArray.h.
References fileOffset(), casacore::StManArrayFile::get(), and casacore::NewDelAllocator< T >::value.
Referenced by getVecBoolV(), getVecComplexV(), getVecDComplexV(), getVecdoubleV(), getVecfloatV(), getVecInt64V(), getVecIntV(), getVecShortV(), getVecStringV(), getVecuCharV(), getVecuIntV(), and getVecuShortV().
|
inlinestaticprivate |
Definition at line 227 of file StIndArray.h.
References fileOffset(), GetVectorGeneric(), casacore::length(), and casacore::NewDelAllocator< T >::value.
|
inlinestaticprivate |
Definition at line 243 of file StIndArray.h.
References fileOffset(), GetVectorGeneric(), casacore::length(), and casacore::NewDelAllocator< T >::value.
|
inlinestaticprivate |
Definition at line 235 of file StIndArray.h.
References fileOffset(), GetVectorGeneric(), casacore::length(), and casacore::NewDelAllocator< T >::value.
| void casacore::StIndArray::incrementRefCount | ( | StManArrayFile & | ios | ) |
Increment the reference count.
| StIndArray & casacore::StIndArray::operator= | ( | const StIndArray & | ) |
Assignment.
References StIndArray().
| void casacore::StIndArray::putArrayV | ( | StManArrayFile & | ios, |
| const ArrayBase & | arr, | ||
| DataType | dtype ) |
Put an array value into the file at the offset held in this object.
The buffer pointed to by dataPtr has to have the correct length (which is guaranteed by the ArrayColumn put function).
|
private |
Put sliced data, i.e.
put a section of an array. This function is used by putSlice to have common functionality in one function. It calls the given in putVec function for chunk of data. In this way the bulk of type-independent code is concentrated in putSliceData resulting in small type-dependent functions.
References casacore::NewDelAllocator< T >::value.
| void casacore::StIndArray::putSliceV | ( | StManArrayFile & | , |
| const Slicer & | , | ||
| const ArrayBase & | dataPtr, | ||
| DataType | dtype ) |
Put a section of the array into the file at the offset held in this object.
The buffer pointed to by dataPtr has to have the correct length (which is guaranteed by the ArrayColumn putSlice function).
|
inlinestaticprivate |
Put a (type-dependent) vector part of a slice.
This function is called for each chunk by putSliceData.
Definition at line 300 of file StIndArray.h.
References fileOffset(), casacore::length(), casacore::NewDelAllocator< T >::value, and PutVectorGeneric().
|
inlinestaticprivate |
Definition at line 336 of file StIndArray.h.
References fileOffset(), casacore::length(), casacore::NewDelAllocator< T >::value, and PutVectorGeneric().
|
inlinestaticprivate |
Definition at line 341 of file StIndArray.h.
References fileOffset(), casacore::length(), casacore::NewDelAllocator< T >::value, and PutVectorGeneric().
|
inlinestaticprivate |
Definition at line 332 of file StIndArray.h.
References fileOffset(), casacore::length(), casacore::NewDelAllocator< T >::value, and PutVectorGeneric().
|
inlinestaticprivate |
Definition at line 328 of file StIndArray.h.
References fileOffset(), casacore::length(), casacore::NewDelAllocator< T >::value, and PutVectorGeneric().
|
inlinestaticprivate |
Definition at line 324 of file StIndArray.h.
References fileOffset(), casacore::length(), casacore::NewDelAllocator< T >::value, and PutVectorGeneric().
|
inlinestaticprivate |
Definition at line 316 of file StIndArray.h.
References fileOffset(), casacore::length(), casacore::NewDelAllocator< T >::value, and PutVectorGeneric().
|
inlinestaticprivate |
Definition at line 308 of file StIndArray.h.
References fileOffset(), casacore::length(), casacore::NewDelAllocator< T >::value, and PutVectorGeneric().
|
inlinestaticprivate |
Definition at line 346 of file StIndArray.h.
References fileOffset(), casacore::length(), casacore::NewDelAllocator< T >::value, and PutVectorGeneric().
|
inlinestaticprivate |
Definition at line 351 of file StIndArray.h.
References fileOffset(), casacore::NewDelAllocator< T >::value, and casacore::StManArrayFile::put().
Referenced by putVecBoolV(), putVecComplexV(), putVecDComplexV(), putVecdoubleV(), putVecfloatV(), putVecInt64V(), putVecIntV(), putVecShortV(), putVecStringV(), putVecuCharV(), putVecuIntV(), and putVecuShortV().
|
inlinestaticprivate |
Definition at line 304 of file StIndArray.h.
References fileOffset(), casacore::length(), casacore::NewDelAllocator< T >::value, and PutVectorGeneric().
|
inlinestaticprivate |
Definition at line 320 of file StIndArray.h.
References fileOffset(), casacore::length(), casacore::NewDelAllocator< T >::value, and PutVectorGeneric().
|
inlinestaticprivate |
Definition at line 312 of file StIndArray.h.
References fileOffset(), casacore::length(), casacore::NewDelAllocator< T >::value, and PutVectorGeneric().
| uInt casacore::StIndArray::refCount | ( | StManArrayFile & | ios | ) |
Get the reference count.
| Bool casacore::StIndArray::setShape | ( | StManArrayFile & | , |
| int | dataType, | ||
| const IPosition & | shape ) |
Set the shape and allocate the array in the file.
This will define the array and fill in the file offset. If the shape is already defined and does not change, nothing is done and a False value is returned. If the shape changes, the old file space is lost.
References casacore::dataType(), and shape().
|
inline |
Get the shape.
Definition at line 154 of file StIndArray.h.
References shape_p.
Referenced by setShape().
|
private |
Definition at line 206 of file StIndArray.h.
|
private |
Definition at line 205 of file StIndArray.h.
Referenced by fileOffset().
|
private |
Definition at line 208 of file StIndArray.h.
Referenced by shape().