casa
5.7.0-16
|
Templated functions to get/put a C-style array from/into AipsIO. More...
#include <AipsIOCarray.h>
Public Member Functions | |
template<class T > | |
void | putAipsIO (AipsIO &aios, uInt n, const T *data) |
Put a C-style array of n elements. More... | |
template<class T > | |
void | getAipsIO (AipsIO &aios, uInt n, T *data) |
Get n elements into an already available C-style array. More... | |
template<class T > | |
void | getnewAipsIO (AipsIO &aios, uInt &n, T **data) |
Get elements into a C-style array to be allocated on the heap. More... | |
Templated functions to get/put a C-style array from/into AipsIO.
Public interface
AipsIOCarray is simply the conventional shorthand for "aips input/output for C-style arrays".
This file declares templated functions to get or put a C-style array of any data type from/into AipsIO. These functions are similar to the AipsIO functions put, get and getnew, but support any data type.
Specializations (using these AipsIO functions) are made for the standard data types. These are much more efficient.
Definition at line 102 of file AipsIOCarray.h.
void casacore::AipsIOCarray_global_functions_AipsIOCarray::getAipsIO | ( | AipsIO & | aios, |
uInt | n, | ||
T * | data | ||
) |
Get n elements into an already available C-style array.
The data buffer must be large enough to hold n values.
void casacore::AipsIOCarray_global_functions_AipsIOCarray::getnewAipsIO | ( | AipsIO & | aios, |
uInt & | n, | ||
T ** | data | ||
) |
Get elements into a C-style array to be allocated on the heap.
First the number of elements will be read. The array will be allocated by this function and must be freed by the user. Its pointer is returned in data. The number of elements is returned in n.
Note: Unfortunately the CFront compiler (and maybe others as well) fail to overload on T*& data
iso; T** data
;
void casacore::AipsIOCarray_global_functions_AipsIOCarray::putAipsIO | ( | AipsIO & | aios, |
uInt | n, | ||
const T * | data | ||
) |
Put a C-style array of n elements.
First the number of elements is put, thereafter all values.