uint32_t CompositionUnderline::read()

in remote/gen-cpp/shared_types.cpp [1664:1752]


uint32_t CompositionUnderline::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_range = false;
  bool isset_color = false;
  bool isset_backgroundColor = false;
  bool isset_thick = false;
  bool isset_style = 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_STRUCT) {
          xfer += this->range.read(iprot);
          isset_range = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->color.read(iprot);
          isset_color = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->backgroundColor.read(iprot);
          isset_backgroundColor = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->thick);
          isset_thick = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          int32_t ecast32;
          xfer += iprot->readI32(ecast32);
          this->style = static_cast<Style::type>(ecast32);
          isset_style = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  if (!isset_range)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_color)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_backgroundColor)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_thick)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_style)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  return xfer;
}