00001 /* 00002 // $Id: //open/dev/fennel/lucidera/bitmap/LbmSeqSegmentReader.cpp#5 $ 00003 // Fennel is a library of data storage and processing components. 00004 // Copyright (C) 2006-2009 LucidEra, Inc. 00005 // Copyright (C) 2006-2009 The Eigenbase Project 00006 // 00007 // This program is free software; you can redistribute it and/or modify it 00008 // under the terms of the GNU General Public License as published by the Free 00009 // Software Foundation; either version 2 of the License, or (at your option) 00010 // any later version approved by The Eigenbase Project. 00011 // 00012 // This program is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with this program; if not, write to the Free Software 00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 */ 00021 00022 #include "fennel/common/CommonPreamble.h" 00023 #include "fennel/exec/ExecStreamBufAccessor.h" 00024 #include "fennel/lucidera/bitmap/LbmSeqSegmentReader.h" 00025 00026 FENNEL_BEGIN_CPPFILE("$Id: //open/dev/fennel/lucidera/bitmap/LbmSeqSegmentReader.cpp#5 $"); 00027 00028 void LbmSeqSegmentReader::init( 00029 SharedExecStreamBufAccessor &pInAccessorInit, 00030 TupleData &bitmapSegTuple) 00031 { 00032 LbmSegmentReaderBase::init(pInAccessorInit, bitmapSegTuple); 00033 } 00034 00035 ExecStreamResult LbmSeqSegmentReader::readSegmentAndAdvance( 00036 LbmByteNumber &byteNum, PBuffer &byteSeg, uint &len) 00037 { 00038 if (pSegDescStart >= pSegDescEnd) { 00039 // read a new bitmap segment tuple from the input stream 00040 ExecStreamResult rc = readBitmapSegTuple(); 00041 if (rc != EXECRC_YIELD) { 00042 return rc; 00043 } 00044 00045 if (!pSegDescStart) { 00046 // single bitmap case 00047 byteNum = byteSegOffset; 00048 byteSeg = pSegStart; 00049 len = byteSegLen; 00050 return EXECRC_YIELD; 00051 } else { 00052 // set byteSegLen to 0 to force advanceSegment() 00053 // to read the initial segment 00054 byteSegLen = 0; 00055 } 00056 } 00057 00058 // advance to the next segment and set the return values 00059 advanceSegment(); 00060 byteNum = byteSegOffset; 00061 byteSeg = pSegStart; 00062 len = byteSegLen; 00063 00064 return EXECRC_YIELD; 00065 } 00066 00067 LcsRid LbmSeqSegmentReader::getSrid() 00068 { 00069 return startRID; 00070 } 00071 00072 FENNEL_END_CPPFILE("$Id: //open/dev/fennel/lucidera/bitmap/LbmSeqSegmentReader.cpp#5 $"); 00073 00074 // End LbmSeqSegmentReader.cpp