casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
casacore::CanonicalIO Class Reference

Class for IO in canonical format. More...

#include <CanonicalIO.h>

Inheritance diagram for casacore::CanonicalIO:
casacore::TypeIO

Public Member Functions

 CanonicalIO (ByteIO *byteIO, uInt bufferLength=4096, Bool takeOver=False)
 Constructor. More...
 
 CanonicalIO (const CanonicalIO &canonicalIO)
 The copy constructor uses reference semantics. More...
 
CanonicalIOoperator= (const CanonicalIO &canonicalIO)
 The assignment operator uses reference semantics. More...
 
 ~CanonicalIO ()
 Destructor, deletes allocated memory. More...
 
virtual size_t write (size_t nvalues, const Bool *value)
 Convert the values and write them to the ByteIO object. More...
 
virtual size_t write (size_t nvalues, const Char *data)
 
virtual size_t write (size_t nvalues, const uChar *data)
 
virtual size_t write (size_t nvalues, const Short *data)
 
virtual size_t write (size_t nvalues, const uShort *data)
 
virtual size_t write (size_t nvalues, const Int *data)
 
virtual size_t write (size_t nvalues, const uInt *data)
 
virtual size_t write (size_t nvalues, const Int64 *data)
 
virtual size_t write (size_t nvalues, const uInt64 *data)
 
virtual size_t write (size_t nvalues, const Float *data)
 
virtual size_t write (size_t nvalues, const Double *data)
 
virtual size_t write (size_t nvalues, const Complex *value)
 
virtual size_t write (size_t nvalues, const DComplex *value)
 
virtual size_t write (size_t nvalues, const String *value)
 
virtual size_t read (size_t nvalues, Bool *value)
 Read the values from the ByteIO object and convert them. More...
 
virtual size_t read (size_t nvalues, Char *data)
 
virtual size_t read (size_t nvalues, uChar *data)
 
virtual size_t read (size_t nvalues, Short *data)
 
virtual size_t read (size_t nvalues, uShort *data)
 
virtual size_t read (size_t nvalues, Int *data)
 
virtual size_t read (size_t nvalues, uInt *data)
 
virtual size_t read (size_t nvalues, Int64 *data)
 
virtual size_t read (size_t nvalues, uInt64 *data)
 
virtual size_t read (size_t nvalues, Float *data)
 
virtual size_t read (size_t nvalues, Double *data)
 
virtual size_t read (size_t nvalues, Complex *value)
 
virtual size_t read (size_t nvalues, DComplex *value)
 
virtual size_t read (size_t nvalues, String *value)
 
- Public Member Functions inherited from casacore::TypeIO
 TypeIO (ByteIO *byteIO, Bool takeOver=False)
 Constructor. More...
 
virtual ~TypeIO ()
 
const ByteIObyteIO () const
 Functions to return a reference to the ByteIO class. More...
 
ByteIObyteIO ()
 
Int64 seek (Int64 offset, ByteIO::SeekOption=ByteIO::Begin)
 This function sets the position on the given offset. More...
 
Int64 seek (Int offset, ByteIO::SeekOption=ByteIO::Begin)
 
Bool isReadable () const
 Is the TypeIO stream readable? More...
 
Bool isWritable () const
 Is the TypeIO stream writable? More...
 
Bool isSeekable () const
 Is the TypeIO stream seekable? More...
 

Private Attributes

char * itsBuffer
 
uInt itsBufferLength
 

Additional Inherited Members

- Protected Member Functions inherited from casacore::TypeIO
 TypeIO (const TypeIO &TypeIO)
 The copy constructor uses reference semantics. More...
 
TypeIOoperator= (const TypeIO &typeIO)
 The assignment operator uses reference semantics. More...
 
- Protected Attributes inherited from casacore::TypeIO
CountedPtr< ByteIOitsByteIO
 This variable keeps a pointer to a ByteIO. More...
 

Detailed Description

Class for IO in canonical format.

Intended use:

Public interface

Review Status

Reviewed By:
Friso Olnon
Date Reviewed:
1996/11/06
Test programs:
tTypeIO

Prerequisite

Synopsis

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.

Constructor & Destructor Documentation

casacore::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.

casacore::CanonicalIO::CanonicalIO ( const CanonicalIO canonicalIO)

The copy constructor uses reference semantics.

casacore::CanonicalIO::~CanonicalIO ( )

Destructor, deletes allocated memory.

Member Function Documentation

CanonicalIO& casacore::CanonicalIO::operator= ( const CanonicalIO canonicalIO)

The assignment operator uses reference semantics.

virtual size_t casacore::CanonicalIO::read ( size_t  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 casacore::TypeIO.

virtual size_t casacore::CanonicalIO::read ( size_t  nvalues,
Char data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::read ( size_t  nvalues,
uChar data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::read ( size_t  nvalues,
Short data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::read ( size_t  nvalues,
uShort data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::read ( size_t  nvalues,
Int data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::read ( size_t  nvalues,
uInt data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::read ( size_t  nvalues,
Int64 data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::read ( size_t  nvalues,
uInt64 data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::read ( size_t  nvalues,
Float data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::read ( size_t  nvalues,
Double data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::read ( size_t  nvalues,
Complex *  value 
)
virtual

Reimplemented from casacore::TypeIO.

virtual size_t casacore::CanonicalIO::read ( size_t  nvalues,
DComplex *  value 
)
virtual

Reimplemented from casacore::TypeIO.

virtual size_t casacore::CanonicalIO::read ( size_t  nvalues,
String value 
)
virtual

Reimplemented from casacore::TypeIO.

virtual size_t casacore::CanonicalIO::write ( size_t  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 casacore::TypeIO.

virtual size_t casacore::CanonicalIO::write ( size_t  nvalues,
const Char data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::write ( size_t  nvalues,
const uChar data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::write ( size_t  nvalues,
const Short data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::write ( size_t  nvalues,
const uShort data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::write ( size_t  nvalues,
const Int data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::write ( size_t  nvalues,
const uInt data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::write ( size_t  nvalues,
const Int64 data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::write ( size_t  nvalues,
const uInt64 data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::write ( size_t  nvalues,
const Float data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::write ( size_t  nvalues,
const Double data 
)
virtual

Implements casacore::TypeIO.

virtual size_t casacore::CanonicalIO::write ( size_t  nvalues,
const Complex *  value 
)
virtual

Reimplemented from casacore::TypeIO.

virtual size_t casacore::CanonicalIO::write ( size_t  nvalues,
const DComplex *  value 
)
virtual

Reimplemented from casacore::TypeIO.

virtual size_t casacore::CanonicalIO::write ( size_t  nvalues,
const String value 
)
virtual

Reimplemented from casacore::TypeIO.

Member Data Documentation

char* casacore::CanonicalIO::itsBuffer
private

Definition at line 139 of file CanonicalIO.h.

uInt casacore::CanonicalIO::itsBufferLength
private

Definition at line 140 of file CanonicalIO.h.


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