コード例 #1
0
ファイル: Types.php プロジェクト: minudika/airavata
 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->computeResourceId);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 2:
                 if ($ftype == TType::STRING) {
                     $xfer += $input->readString($this->hostName);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::LST) {
                     $this->hostAliases = array();
                     $_size23 = 0;
                     $_etype26 = 0;
                     $xfer += $input->readListBegin($_etype26, $_size23);
                     for ($_i27 = 0; $_i27 < $_size23; ++$_i27) {
                         $elem28 = null;
                         $xfer += $input->readString($elem28);
                         $this->hostAliases[] = $elem28;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 4:
                 if ($ftype == TType::LST) {
                     $this->ipAddresses = array();
                     $_size29 = 0;
                     $_etype32 = 0;
                     $xfer += $input->readListBegin($_etype32, $_size29);
                     for ($_i33 = 0; $_i33 < $_size29; ++$_i33) {
                         $elem34 = null;
                         $xfer += $input->readString($elem34);
                         $this->ipAddresses[] = $elem34;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 5:
                 if ($ftype == TType::STRING) {
                     $xfer += $input->readString($this->resourceDescription);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 6:
                 if ($ftype == TType::BOOL) {
                     $xfer += $input->readBool($this->enabled);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 7:
                 if ($ftype == TType::LST) {
                     $this->batchQueues = array();
                     $_size35 = 0;
                     $_etype38 = 0;
                     $xfer += $input->readListBegin($_etype38, $_size35);
                     for ($_i39 = 0; $_i39 < $_size35; ++$_i39) {
                         $elem40 = null;
                         $elem40 = new \Airavata\Model\AppCatalog\ComputeResource\BatchQueue();
                         $xfer += $elem40->read($input);
                         $this->batchQueues[] = $elem40;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 8:
                 if ($ftype == TType::MAP) {
                     $this->fileSystems = array();
                     $_size41 = 0;
                     $_ktype42 = 0;
                     $_vtype43 = 0;
                     $xfer += $input->readMapBegin($_ktype42, $_vtype43, $_size41);
                     for ($_i45 = 0; $_i45 < $_size41; ++$_i45) {
                         $key46 = 0;
                         $val47 = '';
                         $xfer += $input->readI32($key46);
                         $xfer += $input->readString($val47);
                         $this->fileSystems[$key46] = $val47;
                     }
                     $xfer += $input->readMapEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 9:
                 if ($ftype == TType::LST) {
                     $this->jobSubmissionInterfaces = array();
                     $_size48 = 0;
                     $_etype51 = 0;
                     $xfer += $input->readListBegin($_etype51, $_size48);
                     for ($_i52 = 0; $_i52 < $_size48; ++$_i52) {
                         $elem53 = null;
                         $elem53 = new \Airavata\Model\AppCatalog\ComputeResource\JobSubmissionInterface();
                         $xfer += $elem53->read($input);
                         $this->jobSubmissionInterfaces[] = $elem53;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 10:
                 if ($ftype == TType::LST) {
                     $this->dataMovementInterfaces = array();
                     $_size54 = 0;
                     $_etype57 = 0;
                     $xfer += $input->readListBegin($_etype57, $_size54);
                     for ($_i58 = 0; $_i58 < $_size54; ++$_i58) {
                         $elem59 = null;
                         $elem59 = new \Airavata\Model\Data\Movement\DataMovementInterface();
                         $xfer += $elem59->read($input);
                         $this->dataMovementInterfaces[] = $elem59;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 11:
                 if ($ftype == TType::I32) {
                     $xfer += $input->readI32($this->maxMemoryPerNode);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }
コード例 #2
0
ファイル: Types.php プロジェクト: kidaa/airavata
 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->computeResourceId);
         } else {
           $xfer += $input->skip($ftype);
         }
         break;
       case 2:
         if ($ftype == TType::STRING) {
           $xfer += $input->readString($this->hostName);
         } else {
           $xfer += $input->skip($ftype);
         }
         break;
       case 3:
         if ($ftype == TType::LST) {
           $this->hostAliases = array();
           $_size30 = 0;
           $_etype33 = 0;
           $xfer += $input->readListBegin($_etype33, $_size30);
           for ($_i34 = 0; $_i34 < $_size30; ++$_i34)
           {
             $elem35 = null;
             $xfer += $input->readString($elem35);
             $this->hostAliases []= $elem35;
           }
           $xfer += $input->readListEnd();
         } else {
           $xfer += $input->skip($ftype);
         }
         break;
       case 4:
         if ($ftype == TType::LST) {
           $this->ipAddresses = array();
           $_size36 = 0;
           $_etype39 = 0;
           $xfer += $input->readListBegin($_etype39, $_size36);
           for ($_i40 = 0; $_i40 < $_size36; ++$_i40)
           {
             $elem41 = null;
             $xfer += $input->readString($elem41);
             $this->ipAddresses []= $elem41;
           }
           $xfer += $input->readListEnd();
         } else {
           $xfer += $input->skip($ftype);
         }
         break;
       case 5:
         if ($ftype == TType::STRING) {
           $xfer += $input->readString($this->resourceDescription);
         } else {
           $xfer += $input->skip($ftype);
         }
         break;
       case 6:
         if ($ftype == TType::BOOL) {
           $xfer += $input->readBool($this->enabled);
         } else {
           $xfer += $input->skip($ftype);
         }
         break;
       case 7:
         if ($ftype == TType::LST) {
           $this->batchQueues = array();
           $_size42 = 0;
           $_etype45 = 0;
           $xfer += $input->readListBegin($_etype45, $_size42);
           for ($_i46 = 0; $_i46 < $_size42; ++$_i46)
           {
             $elem47 = null;
             $elem47 = new \Airavata\Model\AppCatalog\ComputeResource\BatchQueue();
             $xfer += $elem47->read($input);
             $this->batchQueues []= $elem47;
           }
           $xfer += $input->readListEnd();
         } else {
           $xfer += $input->skip($ftype);
         }
         break;
       case 8:
         if ($ftype == TType::MAP) {
           $this->fileSystems = array();
           $_size48 = 0;
           $_ktype49 = 0;
           $_vtype50 = 0;
           $xfer += $input->readMapBegin($_ktype49, $_vtype50, $_size48);
           for ($_i52 = 0; $_i52 < $_size48; ++$_i52)
           {
             $key53 = 0;
             $val54 = '';
             $xfer += $input->readI32($key53);
             $xfer += $input->readString($val54);
             $this->fileSystems[$key53] = $val54;
           }
           $xfer += $input->readMapEnd();
         } else {
           $xfer += $input->skip($ftype);
         }
         break;
       case 9:
         if ($ftype == TType::LST) {
           $this->jobSubmissionInterfaces = array();
           $_size55 = 0;
           $_etype58 = 0;
           $xfer += $input->readListBegin($_etype58, $_size55);
           for ($_i59 = 0; $_i59 < $_size55; ++$_i59)
           {
             $elem60 = null;
             $elem60 = new \Airavata\Model\AppCatalog\ComputeResource\JobSubmissionInterface();
             $xfer += $elem60->read($input);
             $this->jobSubmissionInterfaces []= $elem60;
           }
           $xfer += $input->readListEnd();
         } else {
           $xfer += $input->skip($ftype);
         }
         break;
       case 10:
         if ($ftype == TType::LST) {
           $this->dataMovementInterfaces = array();
           $_size61 = 0;
           $_etype64 = 0;
           $xfer += $input->readListBegin($_etype64, $_size61);
           for ($_i65 = 0; $_i65 < $_size61; ++$_i65)
           {
             $elem66 = null;
             $elem66 = new \Airavata\Model\AppCatalog\ComputeResource\DataMovementInterface();
             $xfer += $elem66->read($input);
             $this->dataMovementInterfaces []= $elem66;
           }
           $xfer += $input->readListEnd();
         } else {
           $xfer += $input->skip($ftype);
         }
         break;
       case 11:
         if ($ftype == TType::I32) {
           $xfer += $input->readI32($this->maxMemoryPerNode);
         } else {
           $xfer += $input->skip($ftype);
         }
         break;
       default:
         $xfer += $input->skip($ftype);
         break;
     }
     $xfer += $input->readFieldEnd();
   }
   $xfer += $input->readStructEnd();
   return $xfer;
 }