#include <ByteIO.h>
Inheritance diagram for casa::ByteIO:

Part of API
ByteIO is the abstract base class for all classes doing IO on byte streams. Examples of derived classes are RegularFileIO and MemoryIO .
ByteIO contains two enumerations, which define the possible open and seek options on byte streams. These enumerations are used throughout the IO framework.
Make polymorphic operations on byte streams possible.
Definition at line 60 of file ByteIO.h.
Public Types | |
| enum | OpenOption |
| Define the possible ByteIO open options. More... | |
| enum | SeekOption |
| Define the possible seek options. More... | |
Public Member Functions | |
| ByteIO () | |
| The constructor does nothing. | |
| virtual | ~ByteIO () |
| virtual void | write (uInt size, const void *buf)=0 |
Write size bytes to the byte stream. | |
| virtual Int | read (uInt size, void *buf, Bool throwException=True)=0 |
Read size bytes from the byte stream. | |
| virtual void | reopenRW () |
| Reopen the underlying IO stream for read/write access. | |
| virtual Int64 | length ()=0 |
| Get the length of the byte stream. | |
| virtual Bool | isReadable () const=0 |
| Is the byte stream readable? | |
| virtual Bool | isWritable () const=0 |
| Is the byte stream writable? | |
| virtual Bool | isSeekable () const=0 |
| Is the byte stream seekable? | |
| Int64 | seek (Int offset, ByteIO::SeekOption=ByteIO::Begin) |
| This function sets the position on the given offset. | |
| Int64 | seek (Int64 offset, ByteIO::SeekOption=ByteIO::Begin) |
Protected Member Functions | |
| virtual Int64 | doSeek (Int64 offset, ByteIO::SeekOption)=0 |
| ByteIO (const ByteIO &byteIO) | |
| Make copy constructor and assignment protected, so a user cannot use them (but a derived class can). | |
| ByteIO & | operator= (const ByteIO &byteIO) |
| casa::ByteIO::ByteIO | ( | ) | [inline] |
| virtual casa::ByteIO::~ByteIO | ( | ) | [virtual] |
| casa::ByteIO::ByteIO | ( | const ByteIO & | byteIO | ) | [inline, protected] |
| virtual void casa::ByteIO::write | ( | uInt | size, | |
| const void * | buf | |||
| ) | [pure virtual] |
Write size bytes to the byte stream.
Read size bytes from the byte stream.
Returns the number of bytes actually read, or a negative number if an error occured. Will also throw an Exception (AipsError) if the requested number of bytes could not be read unless throwException is set to False.
| virtual void casa::ByteIO::reopenRW | ( | ) | [virtual] |
Reopen the underlying IO stream 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. The default implementation in this base class throws a "not possible" exception if a reopen has to be done.
| Int64 casa::ByteIO::seek | ( | Int | offset, | |
| ByteIO::SeekOption | = ByteIO::Begin | |||
| ) | [inline] |
| Int64 casa::ByteIO::seek | ( | Int64 | offset, | |
| ByteIO::SeekOption | = ByteIO::Begin | |||
| ) | [inline] |
| virtual Int64 casa::ByteIO::length | ( | ) | [pure virtual] |
Get the length of the byte stream.
| virtual Bool casa::ByteIO::isReadable | ( | ) | const [pure virtual] |
Is the byte stream readable?
| virtual Bool casa::ByteIO::isWritable | ( | ) | const [pure virtual] |
Is the byte stream writable?
| virtual Bool casa::ByteIO::isSeekable | ( | ) | const [pure virtual] |
Is the byte stream seekable?
| virtual Int64 casa::ByteIO::doSeek | ( | Int64 | offset, | |
| ByteIO::SeekOption | ||||
| ) | [protected, pure virtual] |
Referenced by seek().
1.5.1