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();
            }
        }
Esempio n. 2
0
 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.I32) {
       Type = (CqlResultType)iprot.ReadI32();
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 2:
     if (field.Type == TType.List) {
       {
         Rows = new List<CqlRow>();
         TList _list79 = iprot.ReadListBegin();
         for( int _i80 = 0; _i80 < _list79.Count; ++_i80)
         {
           CqlRow _elem81 = new CqlRow();
           _elem81 = new CqlRow();
           _elem81.Read(iprot);
           Rows.Add(_elem81);
         }
         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();
 }
Esempio n. 3
0
        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.I32)
                    {
                        Type = (CqlResultType)iprot.ReadI32();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.List)
                    {
                        {
                            Rows = new List <CqlRow>();
                            TList _list75 = iprot.ReadListBegin();
                            for (int _i76 = 0; _i76 < _list75.Count; ++_i76)
                            {
                                CqlRow _elem77 = new CqlRow();
                                _elem77 = new CqlRow();
                                _elem77.Read(iprot);
                                Rows.Add(_elem77);
                            }
                            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();
        }