Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

atoms::Stream Class Reference
[IO Subsystem]

#include <stream.hh>

Inheritance diagram for atoms::Stream:

Inheritance graph
[legend]
Collaboration diagram for atoms::Stream:

Collaboration graph
[legend]
List of all members.

Detailed Description

Abstract unbuffered stream.

This defines the basic interface for stream operations, including error handling.

Definition at line 22 of file stream.hh.

Public Member Functions

virtual ~Stream ()
virtual void close ()=0
 Closes the stream if it is not already closed.

virtual bool isOpen () const=0
 Returns true iff the stream is fully open.

virtual bool isClosed () const=0
 Returns true iff the stream is fully closed.

virtual bool isReadable () const=0
 Returns true iff the stream is readable.

virtual bool isWritable () const=0
 Returns true iff the stream is writable.

virtual bool isSeekable () const=0
 Returns true iff the stream is seekable.

virtual size_t read (void *buf, size_t count)=0
 Reads one to count bytes into buf.

virtual size_t write (const void *buf, size_t size)=0
 Writes one to size bytes from buf.


Protected Attributes

boost::weak_ptr< IOHandlethisWeak
 A weak pointer to 'this' for source in IOError.


Constructor & Destructor Documentation

virtual atoms::Stream::~Stream  )  [inline, virtual]
 

Definition at line 24 of file stream.hh.


Member Function Documentation

virtual void atoms::Stream::close  )  [pure virtual]
 

Closes the stream if it is not already closed.

Implemented in atoms::StreamSocket, atoms::ssl::StreamFilter, and atoms::UNIXStream.

virtual bool atoms::Stream::isClosed  )  const [pure virtual]
 

Returns true iff the stream is fully closed.

Streams may be an intermediate state. For example, stream sockets can be in a 'connecting' state.

See also:
isOpen

Implemented in atoms::ssl::StreamFilter, and atoms::UNIXStream.

virtual bool atoms::Stream::isOpen  )  const [pure virtual]
 

Returns true iff the stream is fully open.

Streams may be an intermediate state. For example, stream sockets can be in a 'connecting' state.

See also:
isClosed

Implemented in atoms::ssl::StreamFilter, and atoms::UNIXStream.

virtual bool atoms::Stream::isReadable  )  const [pure virtual]
 

Returns true iff the stream is readable.

Precondition:
The stream is fully open.

Implemented in atoms::ssl::StreamFilter, and atoms::UNIXStream.

virtual bool atoms::Stream::isSeekable  )  const [pure virtual]
 

Returns true iff the stream is seekable.

Precondition:
The stream is fully open.

Implemented in atoms::ssl::StreamFilter, atoms::UNIXStream, and atoms::SeekableUNIXStream.

virtual bool atoms::Stream::isWritable  )  const [pure virtual]
 

Returns true iff the stream is writable.

Precondition:
The stream is fully open.

Implemented in atoms::ssl::StreamFilter, and atoms::UNIXStream.

virtual size_t atoms::Stream::read void buf,
size_t  count
[pure virtual]
 

Reads one to count bytes into buf.

Atomic; on error no bytes will be read.

Precondition:
The stream is open for reading.
Parameters:
buf will contain the data read.
count the maximum number of bytes to read.
Returns:
The actual number of bytes read.
Exceptions:
IOError as appropriate. See documentation for the specific Stream implementation for details.
IOBlockError in particular - a temporary failure condition. Note that a read operation may block due to either read or write in higher-level streams such as a SSL connection.
StreamEndError when there are no more data to be read. This may be a temporary or permanent condition; see the documentation for the specific Stream implementation for details.
Returns:
The actual number of bytes read.

Implemented in atoms::ssl::StreamFilter, and atoms::UNIXStream.

Referenced by atoms::Buffer::readAndAppend().

virtual size_t atoms::Stream::write const void buf,
size_t  size
[pure virtual]
 

Writes one to size bytes from buf.

Atomic; on error no bytes will be written.

Precondition:
The stream is open for writing.
Parameters:
buf contains the data to be written.
size the maximum number of bytes to write.
Returns:
The actual number of bytes written.
Exceptions:
IOError as appropriate. See documentation for the specific subclass.
IOBlockError in particular - a temporary failure condition. Note that a read operation may block due to either read or write in higher-level streams such as a SSL connection.
Returns:
The actual number of bytes written.

Implemented in atoms::ssl::StreamFilter, and atoms::UNIXStream.

Referenced by atoms::Buffer::writeAndShift().


Member Data Documentation

boost::weak_ptr<IOHandle> atoms::IOHandle::thisWeak [protected, inherited]
 

A weak pointer to 'this' for source in IOError.

Definition at line 175 of file gen.hh.


The documentation for this class was generated from the following file:
Generated on Wed Jun 15 01:21:06 2005 for atoms++ by doxygen 1.3.5