當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Operator::read方法代碼示例

本文整理匯總了PHP中Operator::read方法的典型用法代碼示例。如果您正苦於以下問題:PHP Operator::read方法的具體用法?PHP Operator::read怎麽用?PHP Operator::read使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Operator的用法示例。


在下文中一共展示了Operator::read方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: read

 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::STRING) {
                     $xfer += $input->readString($this->taskId);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 2:
                 if ($ftype == TType::I32) {
                     $xfer += $input->readI32($this->taskType);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::MAP) {
                     $this->taskAttributes = array();
                     $_size39 = 0;
                     $_ktype40 = 0;
                     $_vtype41 = 0;
                     $xfer += $input->readMapBegin($_ktype40, $_vtype41, $_size39);
                     for ($_i43 = 0; $_i43 < $_size39; ++$_i43) {
                         $key44 = '';
                         $val45 = '';
                         $xfer += $input->readString($key44);
                         $xfer += $input->readString($val45);
                         $this->taskAttributes[$key44] = $val45;
                     }
                     $xfer += $input->readMapEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 4:
                 if ($ftype == TType::MAP) {
                     $this->taskCounters = array();
                     $_size46 = 0;
                     $_ktype47 = 0;
                     $_vtype48 = 0;
                     $xfer += $input->readMapBegin($_ktype47, $_vtype48, $_size46);
                     for ($_i50 = 0; $_i50 < $_size46; ++$_i50) {
                         $key51 = '';
                         $val52 = 0;
                         $xfer += $input->readString($key51);
                         $xfer += $input->readI64($val52);
                         $this->taskCounters[$key51] = $val52;
                     }
                     $xfer += $input->readMapEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 5:
                 if ($ftype == TType::STRUCT) {
                     $this->operatorGraph = new \Graph();
                     $xfer += $this->operatorGraph->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 6:
                 if ($ftype == TType::LST) {
                     $this->operatorList = array();
                     $_size53 = 0;
                     $_etype56 = 0;
                     $xfer += $input->readListBegin($_etype56, $_size53);
                     for ($_i57 = 0; $_i57 < $_size53; ++$_i57) {
                         $elem58 = null;
                         $elem58 = new \Operator();
                         $xfer += $elem58->read($input);
                         $this->operatorList[] = $elem58;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 7:
                 if ($ftype == TType::BOOL) {
                     $xfer += $input->readBool($this->done);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 8:
                 if ($ftype == TType::BOOL) {
                     $xfer += $input->readBool($this->started);
//.........這裏部分代碼省略.........
開發者ID:Leolh,項目名稱:hive,代碼行數:101,代碼來源:Types.php


注:本文中的Operator::read方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。