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

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

Definition at line 22 of file ReadRaw.h.

References ARRAY2DSCALARINT32, 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         ILOG_ERROR("type not found");
00033         return ARRAY2DUNKNOWN;
00034     }
00035     p += 6;
00036     String::size_type p2 = line.find(',', p);
00037     String type = line.substr(p, p2-p);
00038 
00039     // parse elemSize:
00040     p = line.find("elemSize:");
00041     if (p == String::npos) {
00042         ILOG_ERROR("elemSize not found");
00043         return ARRAY2DUNKNOWN;
00044     }
00045     p += 10;
00046     p2 = line.find(',', p);
00047     String elemSizeStr = line.substr(p, p2-p);
00048     Int64 elemSize = atoi(elemSizeStr);
00049 
00050     // translate to ArrayType
00051     switch (elemSize) {
00052     case 1:
00053         if (type == "uint8")
00054             return ARRAY2DSCALARUINT8;
00055         if (type == "int32")
00056             return ARRAY2DSCALARINT32;
00057         if (type == "uint64")
00058             return ARRAY2DSCALARUINT64;
00059         if (type == "real64")
00060             return ARRAY2DSCALARREAL64;
00061         break;
00062     case 2:
00063         if (type == "real64")
00064             return ARRAY2DVEC2REAL64;
00065         break;
00066     case 3:
00067         if (type == "uint8")
00068             return ARRAY2DVEC3UINT8;
00069         if (type == "real64")
00070             return ARRAY2DVEC3REAL64;
00071         break;
00072     }
00073     ILOG_ERROR("unknown type " << type << " elemSize " << elemSize);
00074     return ARRAY2DUNKNOWN;
00075 }

Here is the call graph for this function:


Generated on Fri Mar 19 10:58:13 2010 for ImpalaSrc by  doxygen 1.5.1