TupleProjectionAccessor Class Reference

A TupleProjectionAccessor provides a way to efficiently unmarshal selected attributes of a tuple, as explained in the design docs. More...

#include <TupleProjectionAccessor.h>

List of all members.

Public Member Functions

 TupleProjectionAccessor ()
void bind (TupleAccessor const &tupleAccessor, TupleProjection const &tupleProjection)
virtual ~TupleProjectionAccessor ()
void unmarshal (TupleData &tuple) const
void unmarshal (TupleData::iterator tupleIter) const
uint size () const

Private Attributes

TupleAccessor const * pTupleAccessor
std::vector< AttributeAccessor
const * > 
ppAttributeAccessors


Detailed Description

A TupleProjectionAccessor provides a way to efficiently unmarshal selected attributes of a tuple, as explained in the design docs.

Definition at line 40 of file TupleProjectionAccessor.h.


Constructor & Destructor Documentation

TupleProjectionAccessor::TupleProjectionAccessor (  )  [explicit]

Definition at line 32 of file TupleProjectionAccessor.cpp.

References pTupleAccessor.

00033 {
00034     pTupleAccessor = NULL;
00035 }

TupleProjectionAccessor::~TupleProjectionAccessor (  )  [virtual]

Definition at line 37 of file TupleProjectionAccessor.cpp.

00038 {
00039 }


Member Function Documentation

void TupleProjectionAccessor::bind ( TupleAccessor const &  tupleAccessor,
TupleProjection const &  tupleProjection 
)

Definition at line 41 of file TupleProjectionAccessor.cpp.

References TupleAccessor::getAttributeAccessor(), ppAttributeAccessors, and pTupleAccessor.

Referenced by ExecStreamBufAccessor::bindProjection(), BTreeAccessBase::BTreeAccessBase(), ExternalSortMerger::ExternalSortMerger(), ExternalSortRunLoader::ExternalSortRunLoader(), ReshapeExecStream::initCompareData(), LcsClusterReplaceExecStream::initTupleLoadParams(), BTreeSearchExecStream::open(), BTreeReadExecStream::open(), BTreeSearchExecStream::prepare(), ReshapeExecStream::prepare(), and BTreeBuilder::truncateExternal().

00044 {
00045     pTupleAccessor = &tupleAccessor;
00046     ppAttributeAccessors.clear();
00047     for (uint i = 0; i < tupleProjection.size(); ++i) {
00048         ppAttributeAccessors.push_back(
00049             &(tupleAccessor.getAttributeAccessor(tupleProjection[i])));
00050     }
00051 }

void TupleProjectionAccessor::unmarshal ( TupleData tuple  )  const [inline]

Definition at line 54 of file TupleProjectionAccessor.h.

Referenced by ReshapeExecStream::castOutput(), BTreeSearchExecStream::checkNextKey(), ReshapeExecStream::compareInput(), BTreeScanExecStream::execute(), ReshapeExecStream::execute(), LcsClusterReplaceExecStream::getTupleForLoad(), ExternalSortMerger::heapify(), BTreeSearchExecStream::innerFetchLoop(), BTreePrefetchSearchExecStream::innerSearchLoop(), ExternalSortRunLoader::quickSortFindPivot(), ExternalSortRunLoader::quickSortPartition(), BTreeSearchExecStream::readDirectives(), BTreeSearchExecStream::readSearchKey(), BTreeSearchExecStream::readUpperBoundKey(), BTreeSearchExecStream::searchForKey(), BTreeSearchExecStream::testInterval(), BTreeBuilder::truncateExternal(), and ExecStreamBufAccessor::unmarshalProjectedTuple().

00055     {
00056         unmarshal(tuple.begin());
00057     }

void TupleProjectionAccessor::unmarshal ( TupleData::iterator  tupleIter  )  const

Definition at line 53 of file TupleProjectionAccessor.cpp.

References ppAttributeAccessors, and pTupleAccessor.

00054 {
00055     for (uint i = 0; i < ppAttributeAccessors.size(); ++i, ++tupleIter) {
00056         ppAttributeAccessors[i]->unmarshalValue(
00057             *pTupleAccessor,
00058             *tupleIter);
00059     }
00060 }

uint TupleProjectionAccessor::size (  )  const [inline]

Definition at line 61 of file TupleProjectionAccessor.h.

Referenced by BTreeSearchExecStream::readDirectives(), BTreeSearchExecStream::readSearchKey(), and BTreeSearchExecStream::searchForKey().

00062     {
00063         return ppAttributeAccessors.size();
00064     }


Member Data Documentation

TupleAccessor const* TupleProjectionAccessor::pTupleAccessor [private]

Definition at line 42 of file TupleProjectionAccessor.h.

Referenced by bind(), TupleProjectionAccessor(), and unmarshal().

std::vector<AttributeAccessor const *> TupleProjectionAccessor::ppAttributeAccessors [private]

Definition at line 43 of file TupleProjectionAccessor.h.

Referenced by bind(), and unmarshal().


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