Apache.Cassandra.CqlRow.Read C# (CSharp) Method

Read() public method

public Read ( TProtocol iprot ) : void
iprot Thrift.Protocol.TProtocol
return void
    public void Read (TProtocol iprot)
    {
      TField field;
      iprot.ReadStructBegin();
      while (true)
      {
        field = iprot.ReadFieldBegin();
        if (field.Type == TType.Stop) { 
          break;
        }
        switch (field.ID)
        {
          case 1:
            if (field.Type == TType.String) {
              Key = iprot.ReadBinary();
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 2:
            if (field.Type == TType.List) {
              {
                Columns = new List<Column>();
                TList _list69 = iprot.ReadListBegin();
                for( int _i70 = 0; _i70 < _list69.Count; ++_i70)
                {
                  Column _elem71 = new Column();
                  _elem71 = new Column();
                  _elem71.Read(iprot);
                  Columns.Add(_elem71);
                }
                iprot.ReadListEnd();
              }
            } else { 
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          default: 
            TProtocolUtil.Skip(iprot, field.Type);
            break;
        }
        iprot.ReadFieldEnd();
      }
      iprot.ReadStructEnd();
    }

Usage Example

        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_type = false;
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.I32)
                        {
                            Type       = (CqlResultType)iprot.ReadI32();
                            isset_type = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                Rows = new List <CqlRow>();
                                TList _list96 = iprot.ReadListBegin();
                                for (int _i97 = 0; _i97 < _list96.Count; ++_i97)
                                {
                                    CqlRow _elem98;
                                    _elem98 = new CqlRow();
                                    _elem98.Read(iprot);
                                    Rows.Add(_elem98);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.I32)
                        {
                            Num = iprot.ReadI32();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.Struct)
                        {
                            Schema = new CqlMetadata();
                            Schema.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_type)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Type not set");
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
All Usage Examples Of Apache.Cassandra.CqlRow::Read