Пример #1
0
 public function read($input)
 {
     $xfer = 0;
     $fname = null;
     $ftype = 0;
     $fid = 0;
     $xfer += $input->readStructBegin($fname);
     while (true) {
         $xfer += $input->readFieldBegin($fname, $ftype, $fid);
         if ($ftype == TType::STOP) {
             break;
         }
         switch ($fid) {
             case 1:
                 if ($ftype == TType::STRUCT) {
                     $this->boolVal = new \TBoolValue();
                     $xfer += $this->boolVal->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 2:
                 if ($ftype == TType::STRUCT) {
                     $this->byteVal = new \TByteValue();
                     $xfer += $this->byteVal->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::STRUCT) {
                     $this->i16Val = new \TI16Value();
                     $xfer += $this->i16Val->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 4:
                 if ($ftype == TType::STRUCT) {
                     $this->i32Val = new \TI32Value();
                     $xfer += $this->i32Val->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 5:
                 if ($ftype == TType::STRUCT) {
                     $this->i64Val = new \TI64Value();
                     $xfer += $this->i64Val->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 6:
                 if ($ftype == TType::STRUCT) {
                     $this->doubleVal = new \TDoubleValue();
                     $xfer += $this->doubleVal->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 7:
                 if ($ftype == TType::STRUCT) {
                     $this->stringVal = new \TStringValue();
                     $xfer += $this->stringVal->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }
Пример #2
0
 public function read($input)
 {
     $xfer = 0;
     $fname = null;
     $ftype = 0;
     $fid = 0;
     $xfer += $input->readStructBegin($fname);
     while (true) {
         $xfer += $input->readFieldBegin($fname, $ftype, $fid);
         if ($ftype == TType::STOP) {
             break;
         }
         switch ($fid) {
             case 1:
                 if ($ftype == TType::LST) {
                     $this->boolColumn = array();
                     $_size32 = 0;
                     $_etype35 = 0;
                     $xfer += $input->readListBegin($_etype35, $_size32);
                     for ($_i36 = 0; $_i36 < $_size32; ++$_i36) {
                         $elem37 = null;
                         $elem37 = new TBoolValue();
                         $xfer += $elem37->read($input);
                         $this->boolColumn[] = $elem37;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 2:
                 if ($ftype == TType::LST) {
                     $this->byteColumn = array();
                     $_size38 = 0;
                     $_etype41 = 0;
                     $xfer += $input->readListBegin($_etype41, $_size38);
                     for ($_i42 = 0; $_i42 < $_size38; ++$_i42) {
                         $elem43 = null;
                         $elem43 = new TByteValue();
                         $xfer += $elem43->read($input);
                         $this->byteColumn[] = $elem43;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::LST) {
                     $this->i16Column = array();
                     $_size44 = 0;
                     $_etype47 = 0;
                     $xfer += $input->readListBegin($_etype47, $_size44);
                     for ($_i48 = 0; $_i48 < $_size44; ++$_i48) {
                         $elem49 = null;
                         $elem49 = new TI16Value();
                         $xfer += $elem49->read($input);
                         $this->i16Column[] = $elem49;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 4:
                 if ($ftype == TType::LST) {
                     $this->i32Column = array();
                     $_size50 = 0;
                     $_etype53 = 0;
                     $xfer += $input->readListBegin($_etype53, $_size50);
                     for ($_i54 = 0; $_i54 < $_size50; ++$_i54) {
                         $elem55 = null;
                         $elem55 = new TI32Value();
                         $xfer += $elem55->read($input);
                         $this->i32Column[] = $elem55;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 5:
                 if ($ftype == TType::LST) {
                     $this->i64Column = array();
                     $_size56 = 0;
                     $_etype59 = 0;
                     $xfer += $input->readListBegin($_etype59, $_size56);
                     for ($_i60 = 0; $_i60 < $_size56; ++$_i60) {
                         $elem61 = null;
                         $elem61 = new TI64Value();
                         $xfer += $elem61->read($input);
                         $this->i64Column[] = $elem61;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 6:
                 if ($ftype == TType::LST) {
                     $this->doubleColumn = array();
                     $_size62 = 0;
                     $_etype65 = 0;
                     $xfer += $input->readListBegin($_etype65, $_size62);
                     for ($_i66 = 0; $_i66 < $_size62; ++$_i66) {
                         $elem67 = null;
                         $elem67 = new TDoubleValue();
                         $xfer += $elem67->read($input);
                         $this->doubleColumn[] = $elem67;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 7:
                 if ($ftype == TType::LST) {
                     $this->stringColumn = array();
                     $_size68 = 0;
                     $_etype71 = 0;
                     $xfer += $input->readListBegin($_etype71, $_size68);
                     for ($_i72 = 0; $_i72 < $_size68; ++$_i72) {
                         $elem73 = null;
                         $elem73 = new TStringValue();
                         $xfer += $elem73->read($input);
                         $this->stringColumn[] = $elem73;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }