casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
casacore::ByteSinkSource Class Reference

Class for read/write access to data in a given format. More...

#include <ByteSinkSource.h>

Inheritance diagram for casacore::ByteSinkSource:
casacore::ByteSink casacore::ByteSource casacore::BaseSinkSource casacore::BaseSinkSource

Public Member Functions

 ByteSinkSource ()
 Default constructor. More...
 
 ByteSinkSource (TypeIO *typeIO, Bool takeOver=False)
 Construct from given TypeIO object. More...
 
 ByteSinkSource (const ByteSinkSource &sinkSource)
 The copy constructor uses reference semantics. More...
 
ByteSinkSourceoperator= (const ByteSinkSource &sinkSource)
 The assignment operator uses reference semantics. More...
 
 ~ByteSinkSource ()
 
- Public Member Functions inherited from casacore::ByteSink
 ByteSink ()
 Default constructor. More...
 
 ByteSink (TypeIO *typeIO, Bool takeOver=False)
 Construct from given TypeIO object. More...
 
 ByteSink (const ByteSink &sink)
 The copy constructor uses reference semantics. More...
 
ByteSinkoperator= (const ByteSink &sink)
 The assignment operator uses reference semantics. More...
 
 ~ByteSink ()
 destructor More...
 
ByteSinkoperator<< (Bool value)
 These functions write one value of the given type. More...
 
ByteSinkoperator<< (Char value)
 
ByteSinkoperator<< (uChar value)
 
ByteSinkoperator<< (Short value)
 
ByteSinkoperator<< (uShort value)
 
ByteSinkoperator<< (Int value)
 
ByteSinkoperator<< (uInt value)
 
ByteSinkoperator<< (Int64 value)
 
ByteSinkoperator<< (uInt64 value)
 
ByteSinkoperator<< (Float value)
 
ByteSinkoperator<< (Double value)
 
ByteSinkoperator<< (const Complex &value)
 
ByteSinkoperator<< (const DComplex &value)
 
ByteSinkoperator<< (const String &value)
 
ByteSinkoperator<< (const Char *value)
 
void write (size_t nvalues, const Bool *value)
 These functions write multiple values of the given type. More...
 
void write (size_t nvalues, const Char *value)
 
void write (size_t nvalues, const uChar *value)
 
void write (size_t nvalues, const Short *value)
 
void write (size_t nvalues, const uShort *value)
 
void write (size_t nvalues, const Int *value)
 
void write (size_t nvalues, const uInt *value)
 
void write (size_t nvalues, const Int64 *value)
 
void write (size_t nvalues, const uInt64 *value)
 
void write (size_t nvalues, const Float *value)
 
void write (size_t nvalues, const Double *value)
 
void write (size_t nvalues, const Complex *value)
 
void write (size_t nvalues, const DComplex *value)
 
void write (size_t nvalues, const String *value)
 
- Public Member Functions inherited from casacore::BaseSinkSource
TypeIOtypeIO ()
 This functions returns a reference to itsTypeIO. More...
 
const TypeIOtypeIO () const
 
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 SinkSource readable? More...
 
Bool isWritable () const
 Is the SinkSource writable? More...
 
Bool isSeekable () const
 Is the SinkSource seekable? More...
 
Bool isNull () const
 Is the BaseSinkSource unusable? More...
 
- Public Member Functions inherited from casacore::ByteSource
 ByteSource ()
 Default constructor. More...
 
 ByteSource (TypeIO *typeIO, Bool takeOver=False)
 Construct from given TypeIO object. More...
 
 ByteSource (const ByteSource &source)
 The copy constructor uses reference semantics. More...
 
ByteSourceoperator= (const ByteSource &source)
 The assignment operator uses reference semantics. More...
 
 ~ByteSource ()
 destructor More...
 
ByteSourceoperator>> (Bool &value)
 These functions read one value of the given type. More...
 
ByteSourceoperator>> (Char &value)
 
ByteSourceoperator>> (uChar &value)
 
ByteSourceoperator>> (Short &value)
 
ByteSourceoperator>> (uShort &value)
 
ByteSourceoperator>> (Int &value)
 
ByteSourceoperator>> (uInt &value)
 
ByteSourceoperator>> (Int64 &value)
 
ByteSourceoperator>> (uInt64 &value)
 
ByteSourceoperator>> (Float &value)
 
ByteSourceoperator>> (Double &value)
 
ByteSourceoperator>> (Complex &value)
 
ByteSourceoperator>> (DComplex &value)
 
ByteSourceoperator>> (String &value)
 
void read (size_t nvalues, Bool *value)
 These functions read multiple values of the given type. More...
 
void read (size_t nvalues, Char *value)
 
void read (size_t nvalues, uChar *value)
 
void read (size_t nvalues, Short *value)
 
void read (size_t nvalues, uShort *value)
 
void read (size_t nvalues, Int *value)
 
void read (size_t nvalues, uInt *value)
 
void read (size_t nvalues, Int64 *value)
 
void read (size_t nvalues, uInt64 *value)
 
void read (size_t nvalues, Float *value)
 
void read (size_t nvalues, Double *value)
 
void read (size_t nvalues, Complex *value)
 
void read (size_t nvalues, DComplex *value)
 
void read (size_t nvalues, String *value)
 

Additional Inherited Members

- Protected Member Functions inherited from casacore::BaseSinkSource
 BaseSinkSource ()
 
 BaseSinkSource (TypeIO *typeIO, Bool takeOver=False)
 Construct using the given TypeIO. More...
 
 BaseSinkSource (const BaseSinkSource &BaseSinkSource)
 The copy constructor uses reference semantics. More...
 
BaseSinkSourceoperator= (const BaseSinkSource &BaseSinkSource)
 The assignment operator uses reference semantics. More...
 
virtual ~BaseSinkSource ()
 
- Protected Attributes inherited from casacore::BaseSinkSource
CountedPtr< TypeIOitsTypeIO
 This variable keeps a pointer to a TypeIO. More...
 

Detailed Description

Class for read/write access to data in a given format.

Intended use:

Public interface

Review Status

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

Prerequisite

Etymology

This class combines ByteSink and ByteSource.

Synopsis

ByteSinkSource provides read/write access to a typed byte stream in the Casacore IO framework. It is derived from the classes ByteSink and ByteSource, so it combines their functionality.

The object is constructed using a typed byte stream. This stream is an instance of a class derived from class TypeIO. This makes it possible to store the data in any format (e.g. CanonicalIO or RawIO).
In its turn TypeIO uses an instance of a class derived from class ByteIO. This makes it possible to use any output stream (e.g. file, memory).

Example

main
{
Bool valb = True;
RegularFileIO regularFileIO ("test.dat", ByteIO::New);
CanonicalIO canonicalIO(&regularFileIO);
ByteSinkSource sinkSource(&canonicalIO);
sinkSource << valb; // Write a boolean
sinkSource.seek (0); // Reset to begin of IO stream
sinkSource >> valb; // Read a boolean
cout << valb << endl; // Print the boolean
}

Motivation

This class makes it transparant to do IO with different devices and in different ways.

Definition at line 92 of file ByteSinkSource.h.

Constructor & Destructor Documentation

casacore::ByteSinkSource::ByteSinkSource ( )

Default constructor.

This creates an invalid object, but is present for convenience.

casacore::ByteSinkSource::ByteSinkSource ( TypeIO typeIO,
Bool  takeOver = False 
)

Construct from given TypeIO object.

The constructor does not copy the object, but only keeps a pointer to it. If takeOver is true the this class will delete the supplied pointer. Otherwise the caller is responsible for this.

casacore::ByteSinkSource::ByteSinkSource ( const ByteSinkSource sinkSource)

The copy constructor uses reference semantics.

casacore::ByteSinkSource::~ByteSinkSource ( )

Member Function Documentation

ByteSinkSource& casacore::ByteSinkSource::operator= ( const ByteSinkSource sinkSource)

The assignment operator uses reference semantics.


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