uint32_t ExperimentStatistics::read()

in airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/experiment_model_types.cpp [1435:1652]


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

  apache::thrift::protocol::TInputRecursionTracker tracker(*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_allExperimentCount = false;
  bool isset_completedExperimentCount = false;
  bool isset_failedExperimentCount = false;
  bool isset_createdExperimentCount = false;
  bool isset_runningExperimentCount = false;
  bool isset_allExperiments = 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_I32) {
          xfer += iprot->readI32(this->allExperimentCount);
          isset_allExperimentCount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->completedExperimentCount);
          isset_completedExperimentCount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->cancelledExperimentCount);
          this->__isset.cancelledExperimentCount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->failedExperimentCount);
          isset_failedExperimentCount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->createdExperimentCount);
          isset_createdExperimentCount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->runningExperimentCount);
          isset_runningExperimentCount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->allExperiments.clear();
            uint32_t _size49;
            ::apache::thrift::protocol::TType _etype52;
            xfer += iprot->readListBegin(_etype52, _size49);
            this->allExperiments.resize(_size49);
            uint32_t _i53;
            for (_i53 = 0; _i53 < _size49; ++_i53)
            {
              xfer += this->allExperiments[_i53].read(iprot);
            }
            xfer += iprot->readListEnd();
          }
          isset_allExperiments = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->completedExperiments.clear();
            uint32_t _size54;
            ::apache::thrift::protocol::TType _etype57;
            xfer += iprot->readListBegin(_etype57, _size54);
            this->completedExperiments.resize(_size54);
            uint32_t _i58;
            for (_i58 = 0; _i58 < _size54; ++_i58)
            {
              xfer += this->completedExperiments[_i58].read(iprot);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.completedExperiments = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->failedExperiments.clear();
            uint32_t _size59;
            ::apache::thrift::protocol::TType _etype62;
            xfer += iprot->readListBegin(_etype62, _size59);
            this->failedExperiments.resize(_size59);
            uint32_t _i63;
            for (_i63 = 0; _i63 < _size59; ++_i63)
            {
              xfer += this->failedExperiments[_i63].read(iprot);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.failedExperiments = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->cancelledExperiments.clear();
            uint32_t _size64;
            ::apache::thrift::protocol::TType _etype67;
            xfer += iprot->readListBegin(_etype67, _size64);
            this->cancelledExperiments.resize(_size64);
            uint32_t _i68;
            for (_i68 = 0; _i68 < _size64; ++_i68)
            {
              xfer += this->cancelledExperiments[_i68].read(iprot);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.cancelledExperiments = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->createdExperiments.clear();
            uint32_t _size69;
            ::apache::thrift::protocol::TType _etype72;
            xfer += iprot->readListBegin(_etype72, _size69);
            this->createdExperiments.resize(_size69);
            uint32_t _i73;
            for (_i73 = 0; _i73 < _size69; ++_i73)
            {
              xfer += this->createdExperiments[_i73].read(iprot);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.createdExperiments = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->runningExperiments.clear();
            uint32_t _size74;
            ::apache::thrift::protocol::TType _etype77;
            xfer += iprot->readListBegin(_etype77, _size74);
            this->runningExperiments.resize(_size74);
            uint32_t _i78;
            for (_i78 = 0; _i78 < _size74; ++_i78)
            {
              xfer += this->runningExperiments[_i78].read(iprot);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.runningExperiments = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  if (!isset_allExperimentCount)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_completedExperimentCount)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_failedExperimentCount)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_createdExperimentCount)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_runningExperimentCount)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_allExperiments)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  return xfer;
}