uint32_t ApplicationDeploymentDescription::read()

in airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/applicationDeploymentModel_types.cpp [236:451]


uint32_t ApplicationDeploymentDescription::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  bool isset_appDeploymentId = false;
  bool isset_appModuleId = false;
  bool isset_computeHostId = false;
  bool isset_executablePath = false;
  bool isset_parallelism = false;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->appDeploymentId);
          isset_appDeploymentId = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->appModuleId);
          isset_appModuleId = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->computeHostId);
          isset_computeHostId = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->executablePath);
          isset_executablePath = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          int32_t ecast0;
          xfer += iprot->readI32(ecast0);
          this->parallelism = (ApplicationParallelismType::type)ecast0;
          isset_parallelism = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->appDeploymentDescription);
          this->__isset.appDeploymentDescription = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->moduleLoadCmds.clear();
            uint32_t _size1;
            ::apache::thrift::protocol::TType _etype4;
            xfer += iprot->readListBegin(_etype4, _size1);
            this->moduleLoadCmds.resize(_size1);
            uint32_t _i5;
            for (_i5 = 0; _i5 < _size1; ++_i5)
            {
              xfer += iprot->readString(this->moduleLoadCmds[_i5]);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.moduleLoadCmds = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->libPrependPaths.clear();
            uint32_t _size6;
            ::apache::thrift::protocol::TType _etype9;
            xfer += iprot->readListBegin(_etype9, _size6);
            this->libPrependPaths.resize(_size6);
            uint32_t _i10;
            for (_i10 = 0; _i10 < _size6; ++_i10)
            {
              xfer += this->libPrependPaths[_i10].read(iprot);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.libPrependPaths = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->libAppendPaths.clear();
            uint32_t _size11;
            ::apache::thrift::protocol::TType _etype14;
            xfer += iprot->readListBegin(_etype14, _size11);
            this->libAppendPaths.resize(_size11);
            uint32_t _i15;
            for (_i15 = 0; _i15 < _size11; ++_i15)
            {
              xfer += this->libAppendPaths[_i15].read(iprot);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.libAppendPaths = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->setEnvironment.clear();
            uint32_t _size16;
            ::apache::thrift::protocol::TType _etype19;
            xfer += iprot->readListBegin(_etype19, _size16);
            this->setEnvironment.resize(_size16);
            uint32_t _i20;
            for (_i20 = 0; _i20 < _size16; ++_i20)
            {
              xfer += this->setEnvironment[_i20].read(iprot);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.setEnvironment = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->preJobCommands.clear();
            uint32_t _size21;
            ::apache::thrift::protocol::TType _etype24;
            xfer += iprot->readListBegin(_etype24, _size21);
            this->preJobCommands.resize(_size21);
            uint32_t _i25;
            for (_i25 = 0; _i25 < _size21; ++_i25)
            {
              xfer += iprot->readString(this->preJobCommands[_i25]);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.preJobCommands = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->postJobCommands.clear();
            uint32_t _size26;
            ::apache::thrift::protocol::TType _etype29;
            xfer += iprot->readListBegin(_etype29, _size26);
            this->postJobCommands.resize(_size26);
            uint32_t _i30;
            for (_i30 = 0; _i30 < _size26; ++_i30)
            {
              xfer += iprot->readString(this->postJobCommands[_i30]);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.postJobCommands = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  if (!isset_appDeploymentId)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_appModuleId)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_computeHostId)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_executablePath)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_parallelism)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  return xfer;
}