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

List of all members.

Public Member Functions

 ByteSinkSource ()
 Default constructor.
 ByteSinkSource (TypeIO *typeIO, Bool takeOver=False)
 Construct from given TypeIO object.
 ByteSinkSource (const ByteSinkSource &sinkSource)
 The copy constructor uses reference semantics.
ByteSinkSourceoperator= (const ByteSinkSource &sinkSource)
 The assignment operator uses reference semantics.
 ~ByteSinkSource ()

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.

Reimplemented from casacore::ByteSink.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1