本文整理汇总了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);
//.........这里部分代码省略.........