Fennel: ByteOutputStream Class Reference (original) (raw)

ByteOutputStream defines an interface for writing to a stream of bytes. More...

#include <[ByteOutputStream.h](ByteOutputStream%5F8h-source.html)>

Inheritance diagram for ByteOutputStream:

List of all members.

Public Member Functions
void writeBytes (void const *pData, uint cbRequested)
Writes bytes to the stream.
PBuffer getWritePointer (uint cbRequested, uint *pcbActual=NULL)
Copyless alternative for writing bytes to the stream.
void consumeWritePointer (uint cbUsed)
Advances stream position after a call to getWritePointer.
void hardPageBreak ()
Marks the current buffer as complete regardless of how much data it contains.
virtual void setWriteLatency (WriteLatency writeLatency)
Changes the write latency.
template
void writeValue (T const &value)
Writes a fixed-size type to the stream.
FileSize getOffset () const
**Returns:**current offset from beginning of stream
bool isClosed () const
**Returns:**whether the object has been closed
void close ()
Closes this object, releasing any unallocated resources.
Protected Member Functions
ByteOutputStream ()
virtual void flushBuffer (uint cbRequested)=0
Must be implemented by derived class to flush buffered data.
virtual void closeImpl ()
Must be implemented by derived class to release any resources.
void setBuffer (PBuffer pBuffer, uint cbBuffer)
Sets the current buffer to be written.
uint getBytesAvailable () const
**Returns:**number of bytes remaining to be written in current buffer
Protected Attributes
WriteLatency writeLatency
Current write latency mode.
FileSize cbOffset
Byte position in stream.
bool needsClose
Private Attributes
PBuffer pNextByte
Next position to write in output buffer.
uint cbWritable
Number of writable bytes remaining in output buffer.

Detailed Description

ByteOutputStream defines an interface for writing to a stream of bytes.

Definition at line 35 of file ByteOutputStream.h.


Constructor & Destructor Documentation

| ByteOutputStream::ByteOutputStream | ( | | ) | [explicit, protected] | | ---------------------------------- | - | | - | ----------------------- |


Member Function Documentation

virtual void ByteOutputStream::flushBuffer ( uint cbRequested ) [protected, pure virtual]

| void ByteOutputStream::closeImpl | ( | | ) | [protected, virtual] | | -------------------------------- | - | | - | ---------------------- |

void ByteOutputStream::setBuffer ( PBuffer pBuffer,
uint cbBuffer
) [inline, protected]

| uint ByteOutputStream::getBytesAvailable | ( | | ) | const [inline, protected] | | ----------------------------------------------------------------------------------------------------- | - | | - | --------------------------- |

void ByteOutputStream::writeBytes ( void const * pData,
uint cbRequested
)
PBuffer ByteOutputStream::getWritePointer ( uint cbRequested,
uint * pcbActual = NULL
) [inline]

Copyless alternative for writing bytes to the stream.

Provides direct access to the stream's internal buffer, but doesn't move the stream position (see consumeWritePointer).

Parameters:

cbRequested number of contiguous bytes to access; if fewer bytes are currently available in the buffer, the buffer is flushed and a new buffer is returned
pcbActual if non-NULL, receives actual number of contiguous writable bytes, which will always be greater than or equal to cbRequested

Returns:

pointer to cbActual bytes of writable buffer space

Definition at line 141 of file ByteOutputStream.h.

References cbWritable, flushBuffer(), and pNextByte.

Referenced by BTreeWriter::deleteCurrent(), BTreeWriter::insertTupleFromBuffer(), and SegOutputStream::SegOutputStream().

void ByteOutputStream::consumeWritePointer ( uint cbUsed ) [inline]

| void ByteOutputStream::hardPageBreak | ( | | ) | | ------------------------------------ | - | | - |

void ByteOutputStream::setWriteLatency ( WriteLatency writeLatency ) [virtual]

template

void ByteOutputStream::writeValue ( T const & value ) [inline]

| FileSize ByteStream::getOffset | ( | | ) | const [inline, inherited] | | ---------------------------------------------------------------------------------- | - | | - | --------------------------- |

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

Returns:

whether the object has been closed

Definition at line 58 of file ClosableObject.h.

| 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().


Member Data Documentation

Byte position in stream.

Definition at line 41 of file ByteStream.h.

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


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


Generated on Mon Jun 22 04:00:26 2009 for Fennel by doxygen 1.5.1