Example #1
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.Struct)
                        {
                            Transition = new TDDITransition();
                            Transition.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.Struct)
                        {
                            State = new TDDIState();
                            State.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
Example #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.I64)
                        {
                            Id = iprot.ReadI64();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.String)
                        {
                            Name = iprot.ReadString();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.String)
                        {
                            Description = iprot.ReadString();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.List)
                        {
                            {
                                KeyValueMaps = new List <TDDIKeyValueMap>();
                                TList _list628 = iprot.ReadListBegin();
                                for (int _i629 = 0; _i629 < _list628.Count; ++_i629)
                                {
                                    TDDIKeyValueMap _elem630;
                                    _elem630 = new TDDIKeyValueMap();
                                    _elem630.Read(iprot);
                                    KeyValueMaps.Add(_elem630);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.List)
                        {
                            {
                                MinimalCutSets = new List <TDDIMinimalCutSets>();
                                TList _list631 = iprot.ReadListBegin();
                                for (int _i632 = 0; _i632 < _list631.Count; ++_i632)
                                {
                                    TDDIMinimalCutSets _elem633;
                                    _elem633 = new TDDIMinimalCutSets();
                                    _elem633.Read(iprot);
                                    MinimalCutSets.Add(_elem633);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.List)
                        {
                            {
                                Failures = new List <TDDIAbstractFailure>();
                                TList _list634 = iprot.ReadListBegin();
                                for (int _i635 = 0; _i635 < _list634.Count; ++_i635)
                                {
                                    TDDIAbstractFailure _elem636;
                                    _elem636 = new TDDIAbstractFailure();
                                    _elem636.Read(iprot);
                                    Failures.Add(_elem636);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.List)
                        {
                            {
                                SubModels = new List <TDDIAbstractFailureModelRef>();
                                TList _list637 = iprot.ReadListBegin();
                                for (int _i638 = 0; _i638 < _list637.Count; ++_i638)
                                {
                                    TDDIAbstractFailureModelRef _elem639;
                                    _elem639 = new TDDIAbstractFailureModelRef();
                                    _elem639.Read(iprot);
                                    SubModels.Add(_elem639);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.List)
                        {
                            {
                                Transitions = new List <TDDITransition>();
                                TList _list640 = iprot.ReadListBegin();
                                for (int _i641 = 0; _i641 < _list640.Count; ++_i641)
                                {
                                    TDDITransition _elem642;
                                    _elem642 = new TDDITransition();
                                    _elem642.Read(iprot);
                                    Transitions.Add(_elem642);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 9:
                        if (field.Type == TType.List)
                        {
                            {
                                States = new List <TDDIState>();
                                TList _list643 = iprot.ReadListBegin();
                                for (int _i644 = 0; _i644 < _list643.Count; ++_i644)
                                {
                                    TDDIState _elem645;
                                    _elem645 = new TDDIState();
                                    _elem645.Read(iprot);
                                    States.Add(_elem645);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

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