public DependencyLink DeepCopy()
        {
            var tmp0 = new DependencyLink();

            if ((Parent != null))
            {
                tmp0.Parent = this.Parent;
            }
            if ((Child != null))
            {
                tmp0.Child = this.Child;
            }
            tmp0.CallCount = this.CallCount;
            return(tmp0);
        }
Esempio n. 2
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_links = false;
                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)
                        {
                            {
                                Links = new List <DependencyLink>();
                                TList _list0 = await iprot.ReadListBeginAsync(cancellationToken);

                                for (int _i1 = 0; _i1 < _list0.Count; ++_i1)
                                {
                                    DependencyLink _elem2;
                                    _elem2 = new DependencyLink();
                                    await _elem2.ReadAsync(iprot, cancellationToken);

                                    Links.Add(_elem2);
                                }
                                await iprot.ReadListEndAsync(cancellationToken);
                            }
                            isset_links = true;
                        }
                        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);

                if (!isset_links)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }