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)
                        {
                            Ref = new TDDIMalfunction();
                            Ref.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
Ejemplo n.º 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 _list572 = iprot.ReadListBegin();
                                for (int _i573 = 0; _i573 < _list572.Count; ++_i573)
                                {
                                    TDDIKeyValueMap _elem574;
                                    _elem574 = new TDDIKeyValueMap();
                                    _elem574.Read(iprot);
                                    KeyValueMaps.Add(_elem574);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.List)
                        {
                            {
                                Hazards = new List <TDDIHazard>();
                                TList _list575 = iprot.ReadListBegin();
                                for (int _i576 = 0; _i576 < _list575.Count; ++_i576)
                                {
                                    TDDIHazard _elem577;
                                    _elem577 = new TDDIHazard();
                                    _elem577.Read(iprot);
                                    Hazards.Add(_elem577);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.List)
                        {
                            {
                                HazardTypes = new List <TDDIHazardType>();
                                TList _list578 = iprot.ReadListBegin();
                                for (int _i579 = 0; _i579 < _list578.Count; ++_i579)
                                {
                                    TDDIHazardType _elem580;
                                    _elem580 = new TDDIHazardType();
                                    _elem580.Read(iprot);
                                    HazardTypes.Add(_elem580);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.List)
                        {
                            {
                                HazardTypeSystems = new List <TDDIHazardTypeSystem>();
                                TList _list581 = iprot.ReadListBegin();
                                for (int _i582 = 0; _i582 < _list581.Count; ++_i582)
                                {
                                    TDDIHazardTypeSystem _elem583;
                                    _elem583 = new TDDIHazardTypeSystem();
                                    _elem583.Read(iprot);
                                    HazardTypeSystems.Add(_elem583);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.List)
                        {
                            {
                                Malfunctions = new List <TDDIMalfunction>();
                                TList _list584 = iprot.ReadListBegin();
                                for (int _i585 = 0; _i585 < _list584.Count; ++_i585)
                                {
                                    TDDIMalfunction _elem586;
                                    _elem586 = new TDDIMalfunction();
                                    _elem586.Read(iprot);
                                    Malfunctions.Add(_elem586);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 9:
                        if (field.Type == TType.List)
                        {
                            {
                                RiskAssessments = new List <TDDIRiskAssessment>();
                                TList _list587 = iprot.ReadListBegin();
                                for (int _i588 = 0; _i588 < _list587.Count; ++_i588)
                                {
                                    TDDIRiskAssessment _elem589;
                                    _elem589 = new TDDIRiskAssessment();
                                    _elem589.Read(iprot);
                                    RiskAssessments.Add(_elem589);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 10:
                        if (field.Type == TType.List)
                        {
                            {
                                RiskParameters = new List <TDDIAbstractRiskParameter>();
                                TList _list590 = iprot.ReadListBegin();
                                for (int _i591 = 0; _i591 < _list590.Count; ++_i591)
                                {
                                    TDDIAbstractRiskParameter _elem592;
                                    _elem592 = new TDDIAbstractRiskParameter();
                                    _elem592.Read(iprot);
                                    RiskParameters.Add(_elem592);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

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