ByteStream Class Reference

ByteStream is a common base class for ByteInputStream and ByteOutputStream. More...

#include <ByteStream.h>

Inheritance diagram for ByteStream:

ClosableObject ByteInputStream ByteOutputStream SegStream ByteArrayInputStream SegInputStream ByteArrayOutputStream SegOutputStream SpillOutputStream SegInputStream SegOutputStream CrcSegInputStream CrcSegOutputStream CrcSegInputStream CrcSegOutputStream List of all members.

Public Member Functions

FileSize getOffset () const
current offset from beginning of stream

bool isClosed () const
whether the object has been closed

void close ()
 Closes this object, releasing any unallocated resources.

Protected Member Functions

 ByteStream ()
virtual void closeImpl ()=0
 Must be implemented by derived class to release any resources.

Protected Attributes

FileSize cbOffset
 Byte position in stream.
bool needsClose

Detailed Description

ByteStream is a common base class for ByteInputStream and ByteOutputStream.

Definition at line 34 of file ByteStream.h.

Constructor & Destructor Documentation

ByteStream::ByteStream (  )  [explicit, protected]

Definition at line 29 of file ByteStream.cpp.

References cbOffset.

00030 {
00031     cbOffset = 0;
00032 }

Member Function Documentation

FileSize ByteStream::getOffset (  )  const [inline]

current offset from beginning of stream

Definition at line 110 of file ByteStream.h.

References cbOffset.

Referenced by SpillOutputStream::getInputStream(), and ByteInputStream::mark().

00111 {
00112     return cbOffset;
00113 }

virtual void ClosableObject::closeImpl (  )  [protected, pure virtual, inherited]

Must be implemented by derived class to release any resources.

Implemented in CacheImpl< PageT, VictimPolicyT >, ByteArrayInputStream, ByteArrayOutputStream, ByteOutputStream, CheckpointThread, Database, BarrierExecStream, DoubleBufferExecStream, ExecStream, ExecStreamGraphImpl, MockResourceExecStream, ReshapeExecStream, ScratchBufferExecStream, SegBufferExecStream, SegBufferReader, SegBufferReaderExecStream, SegBufferWriter, SegBufferWriterExecStream, JavaSinkExecStream, JavaTransformExecStream, FlatFileBuffer, FlatFileExecStreamImpl, BTreeExecStream, BTreeInsertExecStream, BTreePrefetchSearchExecStream, BTreeReadExecStream, BTreeSearchExecStream, FtrsTableWriterExecStream, LhxAggExecStream, LhxJoinExecStream, LbmBitOpExecStream, LbmChopperExecStream, LbmGeneratorExecStream, LbmIntersectExecStream, LbmMinusExecStream, LbmSplicerExecStream, LbmUnionExecStream, LcsClusterAppendExecStream, LcsRowScanBaseExecStream, LcsRowScanExecStream, DelegatingSegment, DynamicDelegatingSegment, ScratchSegment, SegInputStream, Segment, SegOutputStream, SegPageBackupRestoreDevice, SegStream, SegStreamAllocation, SpillOutputStream, and ExternalSortExecStreamImpl.

Referenced by ClosableObject::close().

bool ClosableObject::isClosed (  )  const [inline, inherited]

whether the object has been closed

Definition at line 58 of file ClosableObject.h.

00059     {
00060         return !needsClose;
00061     }

void ClosableObject::close (  )  [inherited]

Closes this object, releasing any unallocated resources.

Reimplemented in CollectExecStream, CorrelationJoinExecStream, LcsClusterAppendExecStream, and LcsClusterReplaceExecStream.

Definition at line 39 of file ClosableObject.cpp.

References ClosableObject::closeImpl(), and ClosableObject::needsClose.

Referenced by CacheImpl< PageT, VictimPolicyT >::allocatePages(), LcsRowScanBaseExecStream::closeImpl(), ExecStreamGraphImpl::closeImpl(), FlatFileBuffer::open(), ClosableObjectDestructor::operator()(), and Segment::~Segment().

00040 {
00041     if (!needsClose) {
00042         return;
00043     }
00044     needsClose = false;
00045     closeImpl();
00046 }

Member Data Documentation

FileSize ByteStream::cbOffset [protected]

Byte position in stream.

Definition at line 41 of file ByteStream.h.

Referenced by ByteStream(), ByteInputStream::consumeReadPointer(), ByteOutputStream::consumeWritePointer(), getOffset(), SegOutputStream::getSegPos(), SegInputStream::getSegPos(), ByteInputStream::readBytes(), ByteInputStream::reset(), ByteArrayInputStream::resetArray(), ByteInputStream::seekBackward(), SegInputStream::seekSegPos(), and ByteOutputStream::writeBytes().

bool ClosableObject::needsClose [protected, inherited]

Definition at line 44 of file ClosableObject.h.

Referenced by SegStreamAllocation::beginWrite(), ExecStreamGraphImpl::clear(), ClosableObject::ClosableObject(), ClosableObject::close(), FlatFileBuffer::open(), ExecStreamGraphImpl::open(), ExecStream::open(), and ClosableObject::~ClosableObject().

The documentation for this class was generated from the following files:
Generated on Mon Jun 22 04:00:27 2009 for Fennel by  doxygen 1.5.1