casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
casa::LargeRegularFileIO Class Reference

Class for IO on a regular large file. More...

#include <LargeRegularFileIO.h>

Inheritance diagram for casa::LargeRegularFileIO:
casa::LargeFilebufIO casa::ByteIO

List of all members.

Public Member Functions

 LargeRegularFileIO (const RegularFile &regularFile, ByteIO::OpenOption=ByteIO::Old, uInt filebufSize=0)
 Create an IO stream object for a regular file with the given name.
 ~LargeRegularFileIO ()
virtual void reopenRW ()
 Reopen the underlying file for read/write access.
virtual String fileName () const
 Get the file name of the file attached.

Static Public Member Functions

static int openCreate (const RegularFile &file, ByteIO::OpenOption)
 Convenience function to open or create a file.

Private Member Functions

 LargeRegularFileIO (const LargeRegularFileIO &that)
 Copy constructor, should not be used.
LargeRegularFileIOoperator= (const LargeRegularFileIO &that)
 Assignment, should not be used.

Private Attributes

OpenOption itsOption
RegularFile itsRegularFile

Detailed Description

Class for IO on a regular large file.

Intended use:

Public interface

Review Status

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

Prerequisite

Synopsis

This class is a specialization of class ByteIO . It uses a regular file as the data store.

The class is derived from FilebufIO , which contains all functions to access the file. The description of this class explains the use of the filebufSize argument in the constructor.

Example

       // Create a file (which should not exist yet).
       LargeRegularFileIO regio (RegularFile("file.name"), ByeIO::NewNoReplace);
       // Use that as the sink of AipsIO.
       AipsIO stream (&regio);
       // Write values.
       stream << (Int)10;
       stream << True;
       // Seek to beginning of file and read data in.
       stream.setpos (0);
       Int vali;
       Bool valb;
       stream >> vali >> valb;

Definition at line 81 of file LargeRegularFileIO.h.


Constructor & Destructor Documentation

casa::LargeRegularFileIO::LargeRegularFileIO ( const RegularFile regularFile,
ByteIO::OpenOption  = ByteIO::Old,
uInt  filebufSize = 0 
) [explicit]

Create an IO stream object for a regular file with the given name.

The ByteIO option determines if the file will be created or opened for input and/or output.
The argument filebufSize defines the length of the internal buffer in the underlying FilebufIO object. A zero length uses an appropriate default.

Copy constructor, should not be used.


Member Function Documentation

virtual String casa::LargeRegularFileIO::fileName ( ) const [virtual]

Get the file name of the file attached.

Reimplemented from casa::LargeFilebufIO.

static int casa::LargeRegularFileIO::openCreate ( const RegularFile file,
ByteIO::OpenOption   
) [static]

Convenience function to open or create a file.

Optionally it is checked if the file does not exist yet. It returns the file descriptor.

LargeRegularFileIO& casa::LargeRegularFileIO::operator= ( const LargeRegularFileIO that) [private]

Assignment, should not be used.

virtual void casa::LargeRegularFileIO::reopenRW ( ) [virtual]

Reopen the underlying file for read/write access.

Nothing will be done if the stream is writable already. Otherwise it will be reopened and an exception will be thrown if it is not possible to reopen it for read/write access.

Reimplemented from casa::ByteIO.

Referenced by casa::StManArrayFile::reopenRW().


Member Data Documentation

Definition at line 112 of file LargeRegularFileIO.h.

Definition at line 113 of file LargeRegularFileIO.h.


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