Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

template<class ArrayT>
void Impala::Core::Array::ReadRawListVar ( std::vector< ArrayT * > &  list,
Util::IOBuffer *  buffer 
) [inline]

Definition at line 428 of file ReadRaw.h.

References Endian(), Impala::Util::IOBuffer::GetPosition(), ILOG_ERROR, and ILOG_VAR.

Referenced by ReadRawListVar().

00429 {
00430     typedef typename ArrayT::StorType StorT;
00431 
00432     ILOG_VAR(Impala.Core.Array.ReadRawListVar);
00433     Int64 ver;
00434     Int64 binary;
00435     Int64 elemSize;
00436     Int64 nrA;
00437     String compressor;
00438     Int64 linesPerCompressedBlock;
00439     Util::IOBuffer::PositionType startPos = buffer->GetPosition();
00440     if (! ReadRawHeader<ArrayT>(buffer, &ver, &binary, &elemSize, 0, 0, &nrA, 
00441                                 compressor,
00442                                 &linesPerCompressedBlock))
00443     {
00444         return;
00445     }
00446     if (binary)
00447     {
00448         buffer->SetPosition(startPos + 200);
00449         for (Int64 n=0 ; n<nrA ; n++)
00450         {
00451             Int64 width;
00452             Int64 height;
00453             char buf[20];
00454             buffer->Read(buf, 20);
00455             sscanf(buf, "%lld %lld ", &width, &height);
00456             size_t blockSize = width*height*elemSize;
00457             ArrayT* a = ArrayCreate<ArrayT>(width, height);
00458             StorT* dstPtr = a->CPB(0, 0);
00459             size_t nrRead = buffer->Read(dstPtr, sizeof(StorT) * blockSize);
00460             if (nrRead != sizeof(StorT) * blockSize)
00461             {
00462                 ILOG_ERROR("read " << nrRead << " bytes instead of "
00463                            << sizeof(StorT) * blockSize);
00464             }
00465             Endian(a, a);
00466             list.push_back(a);
00467         }
00468     }
00469     else
00470     {
00471         for (Int64 n=0 ; n<nrA ; n++)
00472         {
00473             Int64 width;
00474             Int64 height;
00475             buffer->NativeTypeRead(&width);
00476             buffer->NativeTypeRead(&height);
00477             Int64 blockSize = width*height*elemSize;
00478             ArrayT* a = ArrayCreate<ArrayT>(width, height);
00479             for(Int64 i=0 ; i<height ; i++)
00480             {
00481                 StorT* dstPtr = a->CPB(0, i);
00482                 for(Int64 j=0 ; j<width ; j++)
00483                 {
00484                     for (Int64 k=0 ; k<elemSize ; k++)
00485                     {
00486                         buffer->NativeTypeRead(dstPtr);
00487                         dstPtr++;
00488                     }
00489                 }
00490             }
00491             list.push_back(a);
00492         }
00493     }
00494 }

Here is the call graph for this function:


Generated on Thu Jan 13 09:17:09 2011 for ImpalaSrc by  doxygen 1.5.1