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

ArrayType Impala::Core::Array::ReadRawArrayType ( Util::IOBuffer *  buffer  )  [inline]

Definition at line 22 of file ReadRaw.h.

References ARRAY2DSCALARINT32, ARRAY2DSCALARREAL32, ARRAY2DSCALARREAL64, ARRAY2DSCALARUINT64, ARRAY2DSCALARUINT8, ARRAY2DUNKNOWN, ARRAY2DVEC2REAL64, ARRAY2DVEC3REAL64, ARRAY2DVEC3UINT8, Impala::atoi(), ILOG_ERROR, ILOG_VAR, and Impala::Util::IOBuffer::Read().

Referenced by ReadRawArrayType().

00023 {
00024     ILOG_VAR(Impala.Core.Array.ReadRawArrayType);
00025     char buf[200];
00026     buffer->Read(buf, 200);
00027     String line(buf);
00028 
00029     // parse type:
00030     String::size_type p = line.find("type:");
00031     if (p == String::npos)
00032     {
00033         ILOG_ERROR("type not found");
00034         return ARRAY2DUNKNOWN;
00035     }
00036     p += 6;
00037     String::size_type p2 = line.find(',', p);
00038     String type = line.substr(p, p2-p);
00039 
00040     // parse elemSize:
00041     p = line.find("elemSize:");
00042     if (p == String::npos)
00043     {
00044         ILOG_ERROR("elemSize not found");
00045         return ARRAY2DUNKNOWN;
00046     }
00047     p += 10;
00048     p2 = line.find(',', p);
00049     String elemSizeStr = line.substr(p, p2-p);
00050     Int64 elemSize = atoi(elemSizeStr);
00051 
00052     // translate to ArrayType
00053     switch (elemSize)
00054     {
00055     case 1:
00056         if (type == "uint8")
00057             return ARRAY2DSCALARUINT8;
00058         if (type == "int32")
00059             return ARRAY2DSCALARINT32;
00060         if (type == "uint64")
00061             return ARRAY2DSCALARUINT64;
00062         if (type == "real32")
00063             return ARRAY2DSCALARREAL32;
00064         if (type == "real64")
00065             return ARRAY2DSCALARREAL64;
00066         break;
00067     case 2:
00068         if (type == "real64")
00069             return ARRAY2DVEC2REAL64;
00070         break;
00071     case 3:
00072         if (type == "uint8")
00073             return ARRAY2DVEC3UINT8;
00074         if (type == "real64")
00075             return ARRAY2DVEC3REAL64;
00076         break;
00077     }
00078     ILOG_ERROR("unknown type " << type << " elemSize " << elemSize);
00079     return ARRAY2DUNKNOWN;
00080 }

Here is the call graph for this function:


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