Loading...
Searching...
No Matches
casacore::StreamIO Class Reference
casa package (libcasa_casa) » IO_module

More...

`#include <StreamIO.h>`

## Public Member Functions

| StreamIO (const String &hostname, uShort portNumber)
| Construct a stream that is attached to the specified host on the specified portnumber.
virtual | ~StreamIO ()
| The destructor closes the file.
virtual void | write (Int64 size, const void *buf)
| Write the specified number of bytes.
virtual Int64 | read (Int64 size, void *buf, Bool throwException=True)
| Read size bytes from the tape.
virtual Int64 | length ()
| Get the length of the stream.
virtual Bool | isReadable () const
| Is the stream readable?
virtual Bool | isWritable () const
| Is the stream writable?
virtual Bool | isSeekable () const
| Is the stream seekable?
Public Member Functions inherited from casacore::ByteIO
| ByteIO ()
| The constructor does nothing.
virtual | ~ByteIO ()
virtual void | pwrite (Int64 size, Int64 offset, const void *buf)
| Write size bytes to the byte stream at offset.
virtual Int64 | pread (Int64 size, Int64 offset, void *buf, Bool throwException=True)
| Like read but reads from offset of start of the file The file offset is not changed.
virtual void | reopenRW ()
| Reopen the underlying IO stream for read/write access.
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)
virtual void | flush ()
| Flush the data to the file.
virtual void | fsync ()
| Fsync the file (i.e.
virtual void | resync ()
| Resync the file (i.e.
virtual void | truncate (Int64 size)
| Truncate the file to the given size.
virtual String | fileName () const
| Get the file name of the file attached.

## Protected Member Functions

virtual Int64 | doSeek (Int64 offset, ByteIO::SeekOption)
| Reset the position pointer to the given value.
Protected Member Functions inherited from casacore::ByteIO
| 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)

## Private Member Functions

| StreamIO (const StreamIO &other)
| The following functions are made private so that the compiler does not generate default ones.
StreamIO & | operator= (const StreamIO &other)

## Private Attributes

int | itsSockDesc

## Additional Inherited Members

Public Types inherited from casacore::ByteIO
enum | OpenOption { Old , Update , Append , New , NewNoReplace , Scratch , Delete }
| Define the possible ByteIO open options. More...
enum | SeekOption { Begin , Current , End }
| Define the possible seek options. More...

## Detailed Description

Class for IO on connection oriented socket

### Intended use:

Public interface

### Review Status

Date Reviewed:
  yyyy/mm/dd

### Prerequisite

- ByteIO class
- Tape descriptors

### Synopsis

This class is a specialization of class ByteIO. It uses a file descriptor to read/write data to a Internet (AF_INET) stream.

### Example

### Motivation

This class was needed for the online version of the VLA filler.

Definition at line 63 of file StreamIO.h.

## Constructor & Destructor Documentation

## StreamIO() [1/2]

casacore::StreamIO::StreamIO | ( | const String & | hostname,
|  | uShort | portNumber )

Construct a stream that is attached to the specified host on the specified portnumber.

Name lookup is not currently done so that the dotted quad notation must be used.

Referenced by operator=(), and StreamIO().

## ~StreamIO()

virtual casacore::StreamIO::~StreamIO | ( |  | ) |

virtual

The destructor closes the file.

## StreamIO() [2/2]

casacore::StreamIO::StreamIO | ( | const StreamIO & | other | ) |

private

The following functions are made private so that the compiler does not generate default ones.

They cannot be used and are not defined.

References StreamIO().

## Member Function Documentation

## doSeek()

virtual Int64 casacore::StreamIO::doSeek | ( | Int64 | offset,
|  | ByteIO::SeekOption | )

protected virtual

Reset the position pointer to the given value.

It returns the new position. As stream devices are not seekable calling this function will always throw an AipsError exception.

Implements casacore::ByteIO.

References casacore::offset().

## isReadable()

virtual Bool casacore::StreamIO::isReadable | ( |  | ) | const

virtual

Is the stream readable?

This function always returns True.

Implements casacore::ByteIO.

## isSeekable()

virtual Bool casacore::StreamIO::isSeekable | ( |  | ) | const

virtual

Is the stream seekable?

This function always returns False.

Implements casacore::ByteIO.

## isWritable()

virtual Bool casacore::StreamIO::isWritable | ( |  | ) | const

virtual

Is the stream writable?

This function always returns True.

Implements casacore::ByteIO.

## length()

virtual Int64 casacore::StreamIO::length | ( |  | ) |

virtual

Get the length of the stream.

Not a meaningful function for this class and this function always returns -1.

Implements casacore::ByteIO.

## operator=()

StreamIO & casacore::StreamIO::operator= | ( | const StreamIO & | other | ) |

private

References StreamIO().

## read()

virtual Int64 casacore::StreamIO::read | ( | Int64 | size,
|  | void * | buf,
|  | Bool | throwException = True )

virtual

Read size bytes from the tape.

Returns the number of bytes actually read or a negative number if an error occured. Will throw an exception (AipsError) if the requested number of bytes could not be read, or an error occured, unless throwException is set to False.

Implements casacore::ByteIO.

References casacore::size(), and casacore::True.

## write()

virtual void casacore::StreamIO::write | ( | Int64 | size,
|  | const void * | buf )

virtual

Write the specified number of bytes.

Implements casacore::ByteIO.

References casacore::size().

## Member Data Documentation

## itsSockDesc

int casacore::StreamIO::itsSockDesc

private

Definition at line 108 of file StreamIO.h.

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

- casa/IO/StreamIO.h