casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::ConversionIO Class Reference

Class for IO in a converted format. More...

#include <ConversionIO.h>

Inheritance diagram for casa::ConversionIO:
casa::TypeIO

List of all members.

Public Member Functions

 ConversionIO (DataConversion *dataConversion, ByteIO *byteIO, uInt bufferLength=4096, Bool takeOver=False)
 Constructor.
 ConversionIO (const ConversionIO &conversionIO)
 The copy constructor uses reference semantics.
ConversionIOoperator= (const ConversionIO &conversionIO)
 The assignment operator uses reference semantics.
 ~ConversionIO ()
 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 Member Functions

void init ()
 
     

Private Attributes

CountedPtr< DataConversionitsConversion
uInt itsSizeChar
uInt itsSizeuChar
uInt itsSizeShort
uInt itsSizeuShort
uInt itsSizeInt
uInt itsSizeuInt
uInt itsSizeInt64
uInt itsSizeuInt64
uInt itsSizeFloat
uInt itsSizeDouble
Bool itsCopyChar
Bool itsCopyuChar
Bool itsCopyShort
Bool itsCopyuShort
Bool itsCopyInt
Bool itsCopyuInt
Bool itsCopyInt64
Bool itsCopyuInt64
Bool itsCopyFloat
Bool itsCopyDouble
char * itsBuffer
uInt itsBufferLength

Detailed Description

Class for IO in a converted format.

Intended use:

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> 

Prerequisite

Synopsis

ConversionIO is a specialization of class TypeIO to store data in a converted format.

The class converts the data to/from external 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.

This class is useful when data can be stored in one of multiple formats. Only at construction time the correct DataConversion class has to be given. Thereafter polymorphism ensures that the correct conversion is done when reading or writing.

Definition at line 74 of file ConversionIO.h.


Constructor & Destructor Documentation

casa::ConversionIO::ConversionIO ( DataConversion dataConversion,
ByteIO byteIO,
uInt  bufferLength = 4096,
Bool  takeOver = False 
)

Constructor.

The read/write functions will use the given ByteIO object as the data store and the given DataConversion object as the conversion engine.

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 this this class will be responsible for deleting the DataConversion and ByteIO pointers. Otherwise it is the callers responsibility.

The copy constructor uses reference semantics.

Destructor, deletes allocated memory.


Member Function Documentation

void casa::ConversionIO::init ( ) [private]

     

Initialize the itsSize and itsCopy variables.

ConversionIO& casa::ConversionIO::operator= ( const ConversionIO conversionIO)

The assignment operator uses reference semantics.

virtual uInt casa::ConversionIO::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::ConversionIO::read ( uInt  nvalues,
Char data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::read ( uInt  nvalues,
uChar data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::read ( uInt  nvalues,
Short data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::read ( uInt  nvalues,
uShort data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::read ( uInt  nvalues,
Int data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::read ( uInt  nvalues,
uInt data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::read ( uInt  nvalues,
Int64 data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::read ( uInt  nvalues,
uInt64 data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::read ( uInt  nvalues,
Float data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::read ( uInt  nvalues,
Double data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::read ( uInt  nvalues,
Complex *  value 
) [virtual]

Reimplemented from casa::TypeIO.

virtual uInt casa::ConversionIO::read ( uInt  nvalues,
DComplex *  value 
) [virtual]

Reimplemented from casa::TypeIO.

virtual uInt casa::ConversionIO::read ( uInt  nvalues,
String value 
) [virtual]

Reimplemented from casa::TypeIO.

virtual uInt casa::ConversionIO::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::ConversionIO::write ( uInt  nvalues,
const Char data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::write ( uInt  nvalues,
const uChar data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::write ( uInt  nvalues,
const Short data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::write ( uInt  nvalues,
const uShort data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::write ( uInt  nvalues,
const Int data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::write ( uInt  nvalues,
const uInt data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::write ( uInt  nvalues,
const Int64 data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::write ( uInt  nvalues,
const uInt64 data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::write ( uInt  nvalues,
const Float data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::write ( uInt  nvalues,
const Double data 
) [virtual]

Implements casa::TypeIO.

virtual uInt casa::ConversionIO::write ( uInt  nvalues,
const Complex *  value 
) [virtual]

Reimplemented from casa::TypeIO.

virtual uInt casa::ConversionIO::write ( uInt  nvalues,
const DComplex *  value 
) [virtual]

Reimplemented from casa::TypeIO.

virtual uInt casa::ConversionIO::write ( uInt  nvalues,
const String value 
) [virtual]

Reimplemented from casa::TypeIO.


Member Data Documentation

Definition at line 168 of file ConversionIO.h.

Definition at line 169 of file ConversionIO.h.

Definition at line 146 of file ConversionIO.h.

Definition at line 157 of file ConversionIO.h.

Definition at line 166 of file ConversionIO.h.

Definition at line 165 of file ConversionIO.h.

Definition at line 161 of file ConversionIO.h.

Definition at line 163 of file ConversionIO.h.

Definition at line 159 of file ConversionIO.h.

Definition at line 158 of file ConversionIO.h.

Definition at line 162 of file ConversionIO.h.

Definition at line 164 of file ConversionIO.h.

Definition at line 160 of file ConversionIO.h.

Definition at line 147 of file ConversionIO.h.

Definition at line 156 of file ConversionIO.h.

Definition at line 155 of file ConversionIO.h.

Definition at line 151 of file ConversionIO.h.

Definition at line 153 of file ConversionIO.h.

Definition at line 149 of file ConversionIO.h.

Definition at line 148 of file ConversionIO.h.

Definition at line 152 of file ConversionIO.h.

Definition at line 154 of file ConversionIO.h.

Definition at line 150 of file ConversionIO.h.


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