LbmStreamTupleReader Class Reference

LbmStreamTupleReader is a base class for reading bitmap tuples from an input stream. More...

#include <LbmTupleReader.h>

Inheritance diagram for LbmStreamTupleReader:

LbmTupleReader List of all members.

Public Member Functions

void init (SharedExecStreamBufAccessor &pInAccessorInit, TupleData &bitmapSegTupleInit)
 Initializes reader to start reading bitmap tuples from a specified input stream.
ExecStreamResult read (PTupleData &pTupleData)
 Reads an input tuple.

Private Attributes

SharedExecStreamBufAccessor pInAccessor
 Input stream accessor.
PTupleData pInputTuple
 Pointer to a tupledata containing the input bitmap tuple.

Detailed Description

LbmStreamTupleReader is a base class for reading bitmap tuples from an input stream.

Definition at line 59 of file LbmTupleReader.h.


Member Function Documentation

void LbmStreamTupleReader::init ( SharedExecStreamBufAccessor pInAccessorInit,
TupleData bitmapSegTupleInit 
)

Initializes reader to start reading bitmap tuples from a specified input stream.

Parameters:
pInAccessorInit input stream accessor
bitmapSegTupleInit tuple data for reading tuples

Definition at line 32 of file LbmTupleReader.cpp.

References pInAccessor, and pInputTuple.

Referenced by LbmSegmentReaderBase::init().

00035 {
00036     pInAccessor = pInAccessorInit;
00037     pInputTuple = &bitmapSegTuple;
00038 }

ExecStreamResult LbmStreamTupleReader::read ( PTupleData pTupleData  )  [virtual]

Reads an input tuple.

The tuple read remains valid until the next call to this method.

Returns:
EXECRC_YIELD if read was successful, EXECRC_EOS if there was no more data to be read, or EXECRC_BUF_UNDERFLOW if an input stream buffer was exhausted

Implements LbmTupleReader.

Definition at line 40 of file LbmTupleReader.cpp.

References EXECBUF_EOS, EXECRC_BUF_UNDERFLOW, EXECRC_EOS, EXECRC_YIELD, pInAccessor, and pInputTuple.

00041 {
00042     if (pInAccessor->getState() == EXECBUF_EOS) {
00043         return EXECRC_EOS;
00044     }
00045 
00046     // consume the previous input if there was one
00047     if (pInAccessor->isTupleConsumptionPending()) {
00048         pInAccessor->consumeTuple();
00049     }
00050     if (!pInAccessor->demandData()) {
00051         return EXECRC_BUF_UNDERFLOW;
00052     }
00053 
00054     pInAccessor->unmarshalTuple(*pInputTuple);
00055     return EXECRC_YIELD;
00056 }


Member Data Documentation

SharedExecStreamBufAccessor LbmStreamTupleReader::pInAccessor [private]

Input stream accessor.

Definition at line 65 of file LbmTupleReader.h.

Referenced by init(), and read().

PTupleData LbmStreamTupleReader::pInputTuple [private]

Pointer to a tupledata containing the input bitmap tuple.

Definition at line 70 of file LbmTupleReader.h.

Referenced by init(), and read().


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