public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            TField field;
            await iprot.ReadStructBeginAsync(cancellationToken);

            while (true)
            {
                field = await iprot.ReadFieldBeginAsync(cancellationToken);

                if (field.Type == TType.Stop)
                {
                    break;
                }

                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list8 = await iprot.ReadListBeginAsync(cancellationToken);

                            SpotNearbyItems = new List <SpotNearbyItem>(_list8.Count);
                            for (int _i9 = 0; _i9 < _list8.Count; ++_i9)
                            {
                                SpotNearbyItem _elem10;
                                _elem10 = new SpotNearbyItem();
                                await _elem10.ReadAsync(iprot, cancellationToken);

                                SpotNearbyItems.Add(_elem10);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                default:
                    await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                    break;
                }

                await iprot.ReadFieldEndAsync(cancellationToken);
            }

            await iprot.ReadStructEndAsync(cancellationToken);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
示例#2
0
    public void Read(TProtocol iprot)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            TField field;
            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.List)
                    {
                        {
                            SpotNearbyItems = new List <SpotNearbyItem>();
                            TList _list83 = iprot.ReadListBegin();
                            for (int _i84 = 0; _i84 < _list83.Count; ++_i84)
                            {
                                SpotNearbyItem _elem85;
                                _elem85 = new SpotNearbyItem();
                                _elem85.Read(iprot);
                                SpotNearbyItems.Add(_elem85);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }