casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
casacore::ArrayIO_global_functions_Array_binary_IO Struct Reference

Global functions to read/write binary arrays from/to a file. More...

#include <ArrayIO.h>

Public Member Functions

template<typename T , typename Alloc >
void write_array (const Array< T, Alloc > &the_array, const std::string &fileName)
 Write the values of an array in binary format into a file with the given name. More...
 
template<typename T , typename Alloc >
void write_array (const Array< T, Alloc > &the_array, const char *fileName)
 
template<typename T , typename Alloc >
void read_array (Array< T, Alloc > &the_array, const std::string &fileName)
 Read the values of an array in binary format from a file with the given name. More...
 
template<typename T , typename Alloc >
void read_array (Array< T, Alloc > &the_array, const char *fileName)
 

Detailed Description

Global functions to read/write binary arrays from/to a file.

Intended use:

Public interface

Review Status

Reviewed By:
Gareth Hunt
Date Reviewed:
95Mar31

Synopsis

These global functions provide disk read/write functions for an Array of binary numbers. The write operation is useful, for example, to dump an image in binary form to disk so that it can be displayed with an external utility such as SAOimage.

Example

Matrix<float> picture(256, 256); picture = 0.0;
String fileName="picture.data";
// operations to populate picture
//..\.
write_array (picture, fileName);

To Do

Definition at line 163 of file ArrayIO.h.

Member Function Documentation

template<typename T , typename Alloc >
void casacore::ArrayIO_global_functions_Array_binary_IO::read_array ( Array< T, Alloc > &  the_array,
const std::string &  fileName 
)

Read the values of an array in binary format from a file with the given name.

The number of values read is the size of the Array, thus the file should at least contain that number of values.
Warning: This function is only suitable for built-in data types;

template<typename T , typename Alloc >
void casacore::ArrayIO_global_functions_Array_binary_IO::read_array ( Array< T, Alloc > &  the_array,
const char *  fileName 
)
inline

Definition at line 194 of file ArrayIO.h.

template<typename T , typename Alloc >
void casacore::ArrayIO_global_functions_Array_binary_IO::write_array ( const Array< T, Alloc > &  the_array,
const std::string &  fileName 
)

Write the values of an array in binary format into a file with the given name.

The values are stored in local format, thus are not converted to a canonical format as AipsIO does.
Warning: This function is only suitable for built-in data types;

template<typename T , typename Alloc >
void casacore::ArrayIO_global_functions_Array_binary_IO::write_array ( const Array< T, Alloc > &  the_array,
const char *  fileName 
)
inline

Definition at line 178 of file ArrayIO.h.


The documentation for this struct was generated from the following file: