Esempio n. 1
0
        public void Read(TProtocol iprot)
        {
            bool   isset_value = 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.Struct)
                    {
                        Value = new EmptyStruct();
                        Value.Read(iprot);
                        isset_value = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_value)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
Esempio n. 2
0
        public void Read(TProtocol iprot)
        {
            bool   isset_value1  = false;
            bool   isset_value2  = false;
            bool   isset_value3  = false;
            bool   isset_value4  = false;
            bool   isset_value5  = false;
            bool   isset_value6  = false;
            bool   isset_value7  = false;
            bool   isset_value8  = false;
            bool   isset_value9  = false;
            bool   isset_value10 = false;
            bool   isset_value11 = false;
            bool   isset_value12 = 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.Bool)
                    {
                        Value1       = iprot.ReadBool();
                        isset_value1 = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Byte)
                    {
                        Value2       = iprot.ReadByte();
                        isset_value2 = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Double)
                    {
                        Value3       = iprot.ReadDouble();
                        isset_value3 = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.I16)
                    {
                        Value4       = iprot.ReadI16();
                        isset_value4 = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 5:
                    if (field.Type == TType.I32)
                    {
                        Value5       = iprot.ReadI32();
                        isset_value5 = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 6:
                    if (field.Type == TType.I64)
                    {
                        Value6       = iprot.ReadI64();
                        isset_value6 = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 7:
                    if (field.Type == TType.String)
                    {
                        Value7       = iprot.ReadBinary();
                        isset_value7 = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 8:
                    if (field.Type == TType.String)
                    {
                        Value8       = iprot.ReadString();
                        isset_value8 = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 9:
                    if (field.Type == TType.Struct)
                    {
                        Value9 = new EmptyStruct();
                        Value9.Read(iprot);
                        isset_value9 = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 10:
                    if (field.Type == TType.Map)
                    {
                        {
                            Value10 = new Dictionary <int, int>();
                            TMap _map25 = iprot.ReadMapBegin();
                            for (int _i26 = 0; _i26 < _map25.Count; ++_i26)
                            {
                                int _key27;
                                int _val28;
                                _key27          = iprot.ReadI32();
                                _val28          = iprot.ReadI32();
                                Value10[_key27] = _val28;
                            }
                            iprot.ReadMapEnd();
                        }
                        isset_value10 = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 11:
                    if (field.Type == TType.Set)
                    {
                        {
                            Value11 = new THashSet <int>();
                            TSet _set29 = iprot.ReadSetBegin();
                            for (int _i30 = 0; _i30 < _set29.Count; ++_i30)
                            {
                                int _elem31;
                                _elem31 = iprot.ReadI32();
                                Value11.Add(_elem31);
                            }
                            iprot.ReadSetEnd();
                        }
                        isset_value11 = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 12:
                    if (field.Type == TType.List)
                    {
                        {
                            Value12 = new List <int>();
                            TList _list32 = iprot.ReadListBegin();
                            for (int _i33 = 0; _i33 < _list32.Count; ++_i33)
                            {
                                int _elem34;
                                _elem34 = iprot.ReadI32();
                                Value12.Add(_elem34);
                            }
                            iprot.ReadListEnd();
                        }
                        isset_value12 = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_value1)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_value2)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_value3)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_value4)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_value5)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_value6)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_value7)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_value8)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_value9)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_value10)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_value11)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_value12)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
Esempio n. 3
0
 public StructContainer(EmptyStruct value) : this()
 {
     this.Value = value;
 }
Esempio n. 4
0
 public AllTypesContainer(bool value1, sbyte value2, double value3, short value4, int value5, long value6, byte[] value7, string value8, EmptyStruct value9, Dictionary <int, int> value10, THashSet <int> value11, List <int> value12) : this()
 {
     this.Value1  = value1;
     this.Value2  = value2;
     this.Value3  = value3;
     this.Value4  = value4;
     this.Value5  = value5;
     this.Value6  = value6;
     this.Value7  = value7;
     this.Value8  = value8;
     this.Value9  = value9;
     this.Value10 = value10;
     this.Value11 = value11;
     this.Value12 = value12;
 }