casacore
|
Class for IO in a converted format. More...
#include <ConversionIO.h>
Public Member Functions | |
ConversionIO (DataConversion *dataConversion, ByteIO *byteIO, uInt bufferLength=4096, Bool takeOver=False) | |
Constructor. More... | |
ConversionIO (const ConversionIO &conversionIO) | |
The copy constructor uses reference semantics. More... | |
ConversionIO & | operator= (const ConversionIO &conversionIO) |
The assignment operator uses reference semantics. More... | |
~ConversionIO () | |
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 ByteIO & | byteIO () const |
Functions to return a reference to the ByteIO class. More... | |
ByteIO & | byteIO () |
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 Member Functions | |
void | init () |
Initialize the itsSize and itsCopy variables. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from casacore::TypeIO | |
TypeIO (const TypeIO &TypeIO) | |
The copy constructor uses reference semantics. More... | |
TypeIO & | operator= (const TypeIO &typeIO) |
The assignment operator uses reference semantics. More... | |
Protected Attributes inherited from casacore::TypeIO | |
CountedPtr< ByteIO > | itsByteIO |
This variable keeps a pointer to a ByteIO. More... | |
Class for IO in a converted format.
Public interface
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.
casacore::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.
casacore::ConversionIO::ConversionIO | ( | const ConversionIO & | conversionIO | ) |
The copy constructor uses reference semantics.
casacore::ConversionIO::~ConversionIO | ( | ) |
Destructor, deletes allocated memory.
|
private |
Initialize the itsSize
and itsCopy
variables.
ConversionIO& casacore::ConversionIO::operator= | ( | const ConversionIO & | conversionIO | ) |
The assignment operator uses reference semantics.
|
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 |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Reimplemented from casacore::TypeIO.
|
virtual |
Reimplemented from casacore::TypeIO.
|
virtual |
Reimplemented from casacore::TypeIO.
|
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 |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Implements casacore::TypeIO.
|
virtual |
Reimplemented from casacore::TypeIO.
|
virtual |
Reimplemented from casacore::TypeIO.
|
virtual |
Reimplemented from casacore::TypeIO.
|
private |
Definition at line 168 of file ConversionIO.h.
|
private |
Definition at line 169 of file ConversionIO.h.
|
private |
Definition at line 146 of file ConversionIO.h.
|
private |
Definition at line 157 of file ConversionIO.h.
|
private |
Definition at line 166 of file ConversionIO.h.
|
private |
Definition at line 165 of file ConversionIO.h.
|
private |
Definition at line 161 of file ConversionIO.h.
|
private |
Definition at line 163 of file ConversionIO.h.
|
private |
Definition at line 159 of file ConversionIO.h.
|
private |
Definition at line 158 of file ConversionIO.h.
|
private |
Definition at line 162 of file ConversionIO.h.
|
private |
Definition at line 164 of file ConversionIO.h.
|
private |
Definition at line 160 of file ConversionIO.h.
|
private |
Definition at line 147 of file ConversionIO.h.
|
private |
Definition at line 156 of file ConversionIO.h.
|
private |
Definition at line 155 of file ConversionIO.h.
|
private |
Definition at line 151 of file ConversionIO.h.
|
private |
Definition at line 153 of file ConversionIO.h.
|
private |
Definition at line 149 of file ConversionIO.h.
|
private |
Definition at line 148 of file ConversionIO.h.
|
private |
Definition at line 152 of file ConversionIO.h.
|
private |
Definition at line 154 of file ConversionIO.h.
|
private |
Definition at line 150 of file ConversionIO.h.