casacore
|
Input/output operators for Arrays. More...
#include <ArrayIO.h>
Public Member Functions | |
template<typename T , typename Alloc > | |
LogIO & | operator<< (LogIO &os, const Array< T, Alloc > &a) |
Write a formatted copy of the array to the LogIO output object. More... | |
template<typename T , typename Alloc > | |
AipsIO & | operator<< (AipsIO &, const Array< T, Alloc > &) |
Read or write a binary representation of an Array to a file. More... | |
template<typename T , typename Alloc > | |
void | putArray (AipsIO &, const Array< T, Alloc > &, const char *name) |
template<typename T , typename Alloc > | |
AipsIO & | operator>> (AipsIO &, Array< T, Alloc > &) |
Input/output operators for Arrays.
Public interface
This header was reviewed and revised with the goal of making it an example for those writing global function header files.
ArrayIO is simply the conventional shorthand for "array input/output".
These global functions provide easy input and output of (possibly) large and (possibly) multi-dimensional arrays. Iteration through entire arrays is done behind the scenes, with no effort required of the client programmer. These functions are global, rather than member functions of the Array class, because of the well-known C++ requirement that the first argument to an operator function (as it is declared) is the left operand when the function is called.
Effortless input/output is clearly a big win.
LogIO& casacore::ArrayIO_global_functions_Array_IO::operator<< | ( | LogIO & | os, |
const Array< T, Alloc > & | a | ||
) |
Write a formatted copy of the array to the LogIO output object.
Merely calls the ostream operator<< in turn.
AipsIO& casacore::ArrayIO_global_functions_Array_IO::operator<< | ( | AipsIO & | , |
const Array< T, Alloc > & | |||
) |
Read or write a binary representation of an Array to a file.
Very useful for saving arrays and restoring them later.
The putArray function is put in for forwards compatibility of images (so new images can be read with old release).
AipsIO& casacore::ArrayIO_global_functions_Array_IO::operator>> | ( | AipsIO & | , |
Array< T, Alloc > & | |||
) |
void casacore::ArrayIO_global_functions_Array_IO::putArray | ( | AipsIO & | , |
const Array< T, Alloc > & | , | ||
const char * | name | ||
) |