LECanonicalIO.h

Classes

LECanonicalIO -- Class for IO in little endian canonical format. (full description)

class LECanonicalIO: public TypeIO

Interface

Public Members
explicit LECanonicalIO (ByteIO* byteIO, uInt bufferLength=4096, Bool takeOver=False)
LECanonicalIO (const LECanonicalIO& canonicalIO)
LECanonicalIO& operator= (const LECanonicalIO& canonicalIO)
~LECanonicalIO()
virtual uInt write (uInt nvalues, const Bool* value)
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)
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)

Description

Review Status

Reviewed By:
Friso Olnon
Date Reviewed:
1996/11/06
Programs:
Tests:

Prerequisite

Synopsis

LECanonicalIO is a specialization of class TypeIO to store data in little endian 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.

LECanonical format is little-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.

Member Description

explicit LECanonicalIO (ByteIO* byteIO, uInt bufferLength=4096, Bool takeOver=False)

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.

LECanonicalIO (const LECanonicalIO& canonicalIO)

The copy constructor uses reference semantics

LECanonicalIO& operator= (const LECanonicalIO& canonicalIO)

The assignment operator uses reference semantics

~LECanonicalIO()

Destructor, deletes allocated memory.

virtual uInt write (uInt nvalues, const Bool* value)
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)

Convert the values and write them to the ByteIO object. Bool, complex and String values are handled by the base class.

virtual uInt read (uInt nvalues, Bool* value)
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)

Read the values from the ByteIO object and convert them. Bool, complex and String values are handled by the base class.