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

atoms::Seekable Class Reference
[IO Subsystem]

#include <stream.hh>

Inheritance diagram for atoms::Seekable:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Mix-in to make a Stream or BufferedStream seekable.

Definition at line 105 of file stream.hh.

Public Types

enum  Origin { oSet, oCur, oEnd }
 The origin for a seek operation. More...


Public Member Functions

virtual off_t seek (off_t offset, Origin origin=oSet)=0
 Seek to the given position in the stream.

virtual bool isAppending () const=0
 Returns true iff the stream is in "append mode".

off_t tell ()
 Returns the current position in the stream.


Protected Attributes

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


Member Enumeration Documentation

enum atoms::Seekable::Origin
 

The origin for a seek operation.

Enumeration values:
oSet  Set from the beginning of the stream.
oCur  Set relative to the current position.
oEnd  Set relative to the end of the stream.

Definition at line 108 of file stream.hh.


Member Function Documentation

virtual bool atoms::Seekable::isAppending  )  const [pure virtual]
 

Returns true iff the stream is in "append mode".

In this mode, the stream is atomically positioned at the end of file at the beginning of every write operation.

Precondition:
The stream is open.

Implemented in atoms::SeekableUNIXStream.

virtual off_t atoms::Seekable::seek off_t  offset,
Origin  origin = oSet
[pure virtual]
 

Seek to the given position in the stream.

Precondition:
This is a seekable stream.
Parameters:
offset The offset, in bytes, from the given origin. May be negative for oCur or oEnd origins.
origin The origin; see enumeration definition.
Exceptions:
IOError as appropriate. See documentation for the specific subclass.
Returns:
The resulting offset from the beginning of the file.

Implemented in atoms::SeekableUNIXStream.

Referenced by tell().

off_t atoms::Seekable::tell  )  [inline]
 

Returns the current position in the stream.

Definition at line 135 of file stream.hh.

References oCur, and seek().

Here is the call graph for this function:


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:20:57 2005 for atoms++ by doxygen 1.3.5