示例#1
0
    public async global::System.Threading.Tasks.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 _list66 = await iprot.ReadListBeginAsync(cancellationToken);

                            Start = new List <SpecFraction>(_list66.Count);
                            for (int _i67 = 0; _i67 < _list66.Count; ++_i67)
                            {
                                SpecFraction _elem68;
                                _elem68 = new SpecFraction();
                                await _elem68.ReadAsync(iprot, cancellationToken);

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

                case 2:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list69 = await iprot.ReadListBeginAsync(cancellationToken);

                            Finish = new List <SpecFraction>(_list69.Count);
                            for (int _i70 = 0; _i70 < _list69.Count; ++_i70)
                            {
                                SpecFraction _elem71;
                                _elem71 = new SpecFraction();
                                await _elem71.ReadAsync(iprot, cancellationToken);

                                Finish.Add(_elem71);
                            }
                            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 async global::System.Threading.Tasks.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.I32)
                    {
                        Seq = (KeySeq)await iprot.ReadI32Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 2:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list147 = await iprot.ReadListBeginAsync(cancellationToken);

                            V = new List <SpecFraction>(_list147.Count);
                            for (int _i148 = 0; _i148 < _list147.Count; ++_i148)
                            {
                                SpecFraction _elem149;
                                _elem149 = new SpecFraction();
                                await _elem149.ReadAsync(iprot, cancellationToken);

                                V.Add(_elem149);
                            }
                            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();
        }
    }