casa
$Rev:20696$
|
Class for IO in canonical format. More...
#include <CanonicalIO.h>
Public Member Functions | |
CanonicalIO (ByteIO *byteIO, uInt bufferLength=4096, Bool takeOver=False) | |
Constructor. | |
CanonicalIO (const CanonicalIO &canonicalIO) | |
The copy constructor uses reference semantics. | |
CanonicalIO & | operator= (const CanonicalIO &canonicalIO) |
The assignment operator uses reference semantics. | |
~CanonicalIO () | |
Destructor, deletes allocated memory. | |
virtual uInt | write (uInt nvalues, const Bool *value) |
Convert the values and write them to the ByteIO object. | |
virtual uInt | write (uInt nvalues, const Char *data) |
virtual uInt | write (uInt nvalues, const uChar *data) |
virtual uInt | write (uInt nvalues, const Short *data) |
virtual uInt | write (uInt nvalues, const uShort *data) |
virtual uInt | write (uInt nvalues, const Int *data) |
virtual uInt | write (uInt nvalues, const uInt *data) |
virtual uInt | write (uInt nvalues, const Int64 *data) |
virtual uInt | write (uInt nvalues, const uInt64 *data) |
virtual uInt | write (uInt nvalues, const Float *data) |
virtual uInt | write (uInt nvalues, const Double *data) |
virtual uInt | write (uInt nvalues, const Complex *value) |
virtual uInt | write (uInt nvalues, const DComplex *value) |
virtual uInt | write (uInt nvalues, const String *value) |
virtual uInt | read (uInt nvalues, Bool *value) |
Read the values from the ByteIO object and convert them. | |
virtual uInt | read (uInt nvalues, Char *data) |
virtual uInt | read (uInt nvalues, uChar *data) |
virtual uInt | read (uInt nvalues, Short *data) |
virtual uInt | read (uInt nvalues, uShort *data) |
virtual uInt | read (uInt nvalues, Int *data) |
virtual uInt | read (uInt nvalues, uInt *data) |
virtual uInt | read (uInt nvalues, Int64 *data) |
virtual uInt | read (uInt nvalues, uInt64 *data) |
virtual uInt | read (uInt nvalues, Float *data) |
virtual uInt | read (uInt nvalues, Double *data) |
virtual uInt | read (uInt nvalues, Complex *value) |
virtual uInt | read (uInt nvalues, DComplex *value) |
virtual uInt | read (uInt nvalues, String *value) |
Private Attributes | |
char * | itsBuffer |
uInt | itsBufferLength |
Class for IO in canonical format.
Public interface
<h3>Review Status</h3><dl><dt>Reviewed By:<dd>Friso Olnon<dt>Date Reviewed:<dd>1996/11/06<dt>Test programs:<dd>tTypeIO</dl>
CanonicalIO is a specialization of class TypeIO to store data in canonical format.
The class converts the data to/from canonical data and reads/writes them from/into the ByteIO object given at construction time. Conversion is only done when really needed. If not needed, the data is directly read or written.
Canonical format is big-endian IEEE format, where longs are 8 bytes. Bools are stored as bits to be as space-efficient as possible. This means that on a 32-bit SUN or HP conversions only have to be done for Bools and longs. For a DEC-alpha, however, the data will always be converted because it is a little-endian machine.
Definition at line 73 of file CanonicalIO.h.
casa::CanonicalIO::CanonicalIO | ( | ByteIO * | byteIO, |
uInt | bufferLength = 4096 , |
||
Bool | takeOver = False |
||
) | [explicit] |
Constructor.
The read/write functions will use the given ByteIO object as the data store.
The read and write functions use an intermediate buffer to hold the data in canonical format. For small arrays it uses a fixed buffer with length bufferLength
. For arrays not fitting in this buffer, it uses a temporary buffer allocated on the heap.
If takeOver is True the this class will delete the supplied pointer. Otherwise the caller is responsible for this.
casa::CanonicalIO::CanonicalIO | ( | const CanonicalIO & | canonicalIO | ) |
The copy constructor uses reference semantics.
Destructor, deletes allocated memory.
CanonicalIO& casa::CanonicalIO::operator= | ( | const CanonicalIO & | canonicalIO | ) |
The assignment operator uses reference semantics.
virtual uInt casa::CanonicalIO::read | ( | uInt | nvalues, |
Bool * | value | ||
) | [virtual] |
Read the values from the ByteIO object and convert them.
Bool, complex and String values are handled by the base class.
Reimplemented from casa::TypeIO.
virtual uInt casa::CanonicalIO::read | ( | uInt | nvalues, |
Char * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::read | ( | uInt | nvalues, |
uChar * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::read | ( | uInt | nvalues, |
Short * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::read | ( | uInt | nvalues, |
uShort * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::read | ( | uInt | nvalues, |
Int * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::read | ( | uInt | nvalues, |
uInt * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::read | ( | uInt | nvalues, |
Int64 * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::read | ( | uInt | nvalues, |
uInt64 * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::read | ( | uInt | nvalues, |
Float * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::read | ( | uInt | nvalues, |
Double * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::read | ( | uInt | nvalues, |
Complex * | value | ||
) | [virtual] |
Reimplemented from casa::TypeIO.
virtual uInt casa::CanonicalIO::read | ( | uInt | nvalues, |
DComplex * | value | ||
) | [virtual] |
Reimplemented from casa::TypeIO.
virtual uInt casa::CanonicalIO::read | ( | uInt | nvalues, |
String * | value | ||
) | [virtual] |
Reimplemented from casa::TypeIO.
virtual uInt casa::CanonicalIO::write | ( | uInt | nvalues, |
const Bool * | value | ||
) | [virtual] |
Convert the values and write them to the ByteIO object.
Bool, complex and String values are handled by the base class.
Reimplemented from casa::TypeIO.
virtual uInt casa::CanonicalIO::write | ( | uInt | nvalues, |
const Char * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::write | ( | uInt | nvalues, |
const uChar * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::write | ( | uInt | nvalues, |
const Short * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::write | ( | uInt | nvalues, |
const uShort * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::write | ( | uInt | nvalues, |
const Int * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::write | ( | uInt | nvalues, |
const uInt * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::write | ( | uInt | nvalues, |
const Int64 * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::write | ( | uInt | nvalues, |
const uInt64 * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::write | ( | uInt | nvalues, |
const Float * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::write | ( | uInt | nvalues, |
const Double * | data | ||
) | [virtual] |
Implements casa::TypeIO.
virtual uInt casa::CanonicalIO::write | ( | uInt | nvalues, |
const Complex * | value | ||
) | [virtual] |
Reimplemented from casa::TypeIO.
virtual uInt casa::CanonicalIO::write | ( | uInt | nvalues, |
const DComplex * | value | ||
) | [virtual] |
Reimplemented from casa::TypeIO.
virtual uInt casa::CanonicalIO::write | ( | uInt | nvalues, |
const String * | value | ||
) | [virtual] |
Reimplemented from casa::TypeIO.
char* casa::CanonicalIO::itsBuffer [private] |
Definition at line 139 of file CanonicalIO.h.
uInt casa::CanonicalIO::itsBufferLength [private] |
Definition at line 140 of file CanonicalIO.h.