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

Class for IO on connection oriented socket. More...

#include <StreamIO.h>

Inheritance diagram for casa::StreamIO:
casa::ByteIO

List of all members.

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 (uInt size, const void *buf)
 Write the specified number of bytes.
virtual Int read (uInt 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 readabale? This function always returns True.
virtual Bool isWritable () const
 Is the tape device writable? This function always returns True.
virtual Bool isSeekable () const
 Is the tape device seekable? This function always returns False.

Protected Member Functions

virtual Int64 doSeek (Int64 offset, ByteIO::SeekOption)
 Reset the position pointer to the given value.

Private Member Functions

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

Private Attributes

int itsSockDesc

Detailed Description

Class for IO on connection oriented socket.

Intended use:

Public interface

 <h3>Review Status</h3><dl><dt>Date Reviewed:<dd>yyyy/mm/dd</dl> 

Prerequisite

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 65 of file StreamIO.h.


Constructor & Destructor Documentation

casa::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.

virtual casa::StreamIO::~StreamIO ( ) [virtual]

The destructor closes the file.

casa::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.


Member Function Documentation

virtual Int64 casa::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 casa::ByteIO.

virtual Bool casa::StreamIO::isReadable ( ) const [virtual]

Is the stream readabale? This function always returns True.

Implements casa::ByteIO.

virtual Bool casa::StreamIO::isSeekable ( ) const [virtual]

Is the tape device seekable? This function always returns False.

Implements casa::ByteIO.

virtual Bool casa::StreamIO::isWritable ( ) const [virtual]

Is the tape device writable? This function always returns True.

Implements casa::ByteIO.

virtual Int64 casa::StreamIO::length ( ) [virtual]

Get the length of the stream.

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

Implements casa::ByteIO.

StreamIO& casa::StreamIO::operator= ( const StreamIO other) [private]
virtual Int casa::StreamIO::read ( uInt  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 casa::ByteIO.

virtual void casa::StreamIO::write ( uInt  size,
const void *  buf 
) [virtual]

Write the specified number of bytes.

Implements casa::ByteIO.


Member Data Documentation

Definition at line 110 of file StreamIO.h.


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