Loading...
Searching...
No Matches
casacore::ConversionIO Class Reference
casa package (libcasa_casa) » IO_module

More...

`#include <ConversionIO.h>`

## Public Member Functions

| ConversionIO (const std::shared_ptr< DataConversion > &dataConversion, const std::shared_ptr< ByteIO > &byteIO, uInt bufferLength=4096)
| Constructor.
| ConversionIO (const ConversionIO &conversionIO)
| The copy constructor uses reference semantics.
ConversionIO & | operator= (const ConversionIO &conversionIO)
| The assignment operator uses reference semantics.
| ~ConversionIO ()
| Destructor, deletes allocated memory.
virtual size_t | write (size_t nvalues, const Bool *value)
| Convert the values and write them to the ByteIO object.
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.
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 (const std::shared_ptr< ByteIO > &byteIO)
| Constructor.
virtual | ~TypeIO ()
const ByteIO & | byteIO () const
| Functions to return a reference to the ByteIO class.
ByteIO & | byteIO ()
Int64 | seek (Int64 offset, ByteIO::SeekOption=ByteIO::Begin)
| This function sets the position on the given offset.
Int64 | seek (Int offset, ByteIO::SeekOption=ByteIO::Begin)
Bool | isReadable () const
| Is the TypeIO stream readable?
Bool | isWritable () const
| Is the TypeIO stream writable?
Bool | isSeekable () const
| Is the TypeIO stream seekable?

## Private Member Functions

void | init ()
| Initialize the itsSize and itsCopy variables.

## Private Attributes

std::shared_ptr< DataConversion > | itsConversion
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

## Additional Inherited Members

Protected Member Functions inherited from casacore::TypeIO
| TypeIO (const TypeIO &TypeIO)
| The copy constructor uses reference semantics.
TypeIO & | operator= (const TypeIO &typeIO)
| The assignment operator uses reference semantics.
Protected Attributes inherited from casacore::TypeIO
std::shared_ptr< ByteIO > | itsByteIO
| This variable keeps a pointer to a ByteIO.

## Detailed Description

Class for IO in a converted format.

### Intended use:

Public interface

### Review Status

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

### Prerequisite

- ByteIO class and derived classes
- TypeIO class
- DataConversion

### 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 72 of file ConversionIO.h.

## Constructor & Destructor Documentation

## ConversionIO() [1/2]

casacore::ConversionIO::ConversionIO | ( | const std::shared_ptr< DataConversion > & | dataConversion,
|  | const std::shared_ptr< ByteIO > & | byteIO,
|  | uInt | bufferLength = 4096 )

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.

References casacore::TypeIO::byteIO().

Referenced by ConversionIO(), and operator=().

## ConversionIO() [2/2]

casacore::ConversionIO::ConversionIO | ( | const ConversionIO & | conversionIO | ) |

The copy constructor uses reference semantics.

References ConversionIO().

## ~ConversionIO()

casacore::ConversionIO::~ConversionIO | ( |  | ) |

Destructor, deletes allocated memory.

## Member Function Documentation

## init()

void casacore::ConversionIO::init | ( |  | ) |

private

Initialize the itsSize and itsCopy variables.

## operator=()

ConversionIO & casacore::ConversionIO::operator= | ( | const ConversionIO & | conversionIO | ) |

The assignment operator uses reference semantics.

References ConversionIO().

## read() [1/14]

virtual size_t casacore::ConversionIO::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.

References casacore::NewDelAllocator< T >::value.

## read() [2/14]

virtual size_t casacore::ConversionIO::read | ( | size_t | nvalues,
|  | Char * | data )

virtual

Implements casacore::TypeIO.

## read() [3/14]

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

virtual

Reimplemented from casacore::TypeIO.

References casacore::NewDelAllocator< T >::value.

## read() [4/14]

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

virtual

Reimplemented from casacore::TypeIO.

References casacore::NewDelAllocator< T >::value.

## read() [5/14]

virtual size_t casacore::ConversionIO::read | ( | size_t | nvalues,
|  | Double * | data )

virtual

Implements casacore::TypeIO.

## read() [6/14]

virtual size_t casacore::ConversionIO::read | ( | size_t | nvalues,
|  | Float * | data )

virtual

Implements casacore::TypeIO.

## read() [7/14]

virtual size_t casacore::ConversionIO::read | ( | size_t | nvalues,
|  | Int * | data )

virtual

Implements casacore::TypeIO.

## read() [8/14]

virtual size_t casacore::ConversionIO::read | ( | size_t | nvalues,
|  | Int64 * | data )

virtual

Implements casacore::TypeIO.

## read() [9/14]

virtual size_t casacore::ConversionIO::read | ( | size_t | nvalues,
|  | Short * | data )

virtual

Implements casacore::TypeIO.

## read() [10/14]

virtual size_t casacore::ConversionIO::read | ( | size_t | nvalues,
|  | String * | value )

virtual

Reimplemented from casacore::TypeIO.

References casacore::NewDelAllocator< T >::value.

## read() [11/14]

virtual size_t casacore::ConversionIO::read | ( | size_t | nvalues,
|  | uChar * | data )

virtual

Implements casacore::TypeIO.

## read() [12/14]

virtual size_t casacore::ConversionIO::read | ( | size_t | nvalues,
|  | uInt * | data )

virtual

Implements casacore::TypeIO.

## read() [13/14]

virtual size_t casacore::ConversionIO::read | ( | size_t | nvalues,
|  | uInt64 * | data )

virtual

Implements casacore::TypeIO.

## read() [14/14]

virtual size_t casacore::ConversionIO::read | ( | size_t | nvalues,
|  | uShort * | data )

virtual

Implements casacore::TypeIO.

## write() [1/14]

virtual size_t casacore::ConversionIO::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.

References casacore::NewDelAllocator< T >::value.

## write() [2/14]

virtual size_t casacore::ConversionIO::write | ( | size_t | nvalues,
|  | const Char * | data )

virtual

Implements casacore::TypeIO.

## write() [3/14]

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

virtual

Reimplemented from casacore::TypeIO.

References casacore::NewDelAllocator< T >::value.

## write() [4/14]

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

virtual

Reimplemented from casacore::TypeIO.

References casacore::NewDelAllocator< T >::value.

## write() [5/14]

virtual size_t casacore::ConversionIO::write | ( | size_t | nvalues,
|  | const Double * | data )

virtual

Implements casacore::TypeIO.

## write() [6/14]

virtual size_t casacore::ConversionIO::write | ( | size_t | nvalues,
|  | const Float * | data )

virtual

Implements casacore::TypeIO.

## write() [7/14]

virtual size_t casacore::ConversionIO::write | ( | size_t | nvalues,
|  | const Int * | data )

virtual

Implements casacore::TypeIO.

## write() [8/14]

virtual size_t casacore::ConversionIO::write | ( | size_t | nvalues,
|  | const Int64 * | data )

virtual

Implements casacore::TypeIO.

## write() [9/14]

virtual size_t casacore::ConversionIO::write | ( | size_t | nvalues,
|  | const Short * | data )

virtual

Implements casacore::TypeIO.

## write() [10/14]

virtual size_t casacore::ConversionIO::write | ( | size_t | nvalues,
|  | const String * | value )

virtual

Reimplemented from casacore::TypeIO.

References casacore::NewDelAllocator< T >::value.

## write() [11/14]

virtual size_t casacore::ConversionIO::write | ( | size_t | nvalues,
|  | const uChar * | data )

virtual

Implements casacore::TypeIO.

## write() [12/14]

virtual size_t casacore::ConversionIO::write | ( | size_t | nvalues,
|  | const uInt * | data )

virtual

Implements casacore::TypeIO.

## write() [13/14]

virtual size_t casacore::ConversionIO::write | ( | size_t | nvalues,
|  | const uInt64 * | data )

virtual

Implements casacore::TypeIO.

## write() [14/14]

virtual size_t casacore::ConversionIO::write | ( | size_t | nvalues,
|  | const uShort * | data )

virtual

Implements casacore::TypeIO.

## Member Data Documentation

## itsBuffer

char* casacore::ConversionIO::itsBuffer

private

Definition at line 163 of file ConversionIO.h.

## itsBufferLength

uInt casacore::ConversionIO::itsBufferLength

private

Definition at line 164 of file ConversionIO.h.

## itsConversion

std::shared_ptr<DataConversion> casacore::ConversionIO::itsConversion

private

Definition at line 141 of file ConversionIO.h.

## itsCopyChar

Bool casacore::ConversionIO::itsCopyChar

private

Definition at line 152 of file ConversionIO.h.

## itsCopyDouble

Bool casacore::ConversionIO::itsCopyDouble

private

Definition at line 161 of file ConversionIO.h.

## itsCopyFloat

Bool casacore::ConversionIO::itsCopyFloat

private

Definition at line 160 of file ConversionIO.h.

## itsCopyInt

Bool casacore::ConversionIO::itsCopyInt

private

Definition at line 156 of file ConversionIO.h.

## itsCopyInt64

Bool casacore::ConversionIO::itsCopyInt64

private

Definition at line 158 of file ConversionIO.h.

## itsCopyShort

Bool casacore::ConversionIO::itsCopyShort

private

Definition at line 154 of file ConversionIO.h.

## itsCopyuChar

Bool casacore::ConversionIO::itsCopyuChar

private

Definition at line 153 of file ConversionIO.h.

## itsCopyuInt

Bool casacore::ConversionIO::itsCopyuInt

private

Definition at line 157 of file ConversionIO.h.

## itsCopyuInt64

Bool casacore::ConversionIO::itsCopyuInt64

private

Definition at line 159 of file ConversionIO.h.

## itsCopyuShort

Bool casacore::ConversionIO::itsCopyuShort

private

Definition at line 155 of file ConversionIO.h.

## itsSizeChar

uInt casacore::ConversionIO::itsSizeChar

private

Definition at line 142 of file ConversionIO.h.

## itsSizeDouble

uInt casacore::ConversionIO::itsSizeDouble

private

Definition at line 151 of file ConversionIO.h.

## itsSizeFloat

uInt casacore::ConversionIO::itsSizeFloat

private

Definition at line 150 of file ConversionIO.h.

## itsSizeInt

uInt casacore::ConversionIO::itsSizeInt

private

Definition at line 146 of file ConversionIO.h.

## itsSizeInt64

uInt casacore::ConversionIO::itsSizeInt64

private

Definition at line 148 of file ConversionIO.h.

## itsSizeShort

uInt casacore::ConversionIO::itsSizeShort

private

Definition at line 144 of file ConversionIO.h.

## itsSizeuChar

uInt casacore::ConversionIO::itsSizeuChar

private

Definition at line 143 of file ConversionIO.h.

## itsSizeuInt

uInt casacore::ConversionIO::itsSizeuInt

private

Definition at line 147 of file ConversionIO.h.

## itsSizeuInt64

uInt casacore::ConversionIO::itsSizeuInt64

private

Definition at line 149 of file ConversionIO.h.

## itsSizeuShort

uInt casacore::ConversionIO::itsSizeuShort

private

Definition at line 145 of file ConversionIO.h.

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

- casa/IO/ConversionIO.h