コード例 #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.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 _list84 = iprot.ReadListBegin();
                                for (int _i85 = 0; _i85 < _list84.Count; ++_i85)
                                {
                                    TDDIKeyValueMap _elem86;
                                    _elem86 = new TDDIKeyValueMap();
                                    _elem86.Read(iprot);
                                    KeyValueMaps.Add(_elem86);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.List)
                        {
                            {
                                DependabilityRequirements = new List <TDDIAbstractDependabilityRequirementRef>();
                                TList _list87 = iprot.ReadListBegin();
                                for (int _i88 = 0; _i88 < _list87.Count; ++_i88)
                                {
                                    TDDIAbstractDependabilityRequirementRef _elem89;
                                    _elem89 = new TDDIAbstractDependabilityRequirementRef();
                                    _elem89.Read(iprot);
                                    DependabilityRequirements.Add(_elem89);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.Struct)
                        {
                            AssuranceLevel = new TDDIAssuranceLevel();
                            AssuranceLevel.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.List)
                        {
                            {
                                SubFunctions = new List <TDDIAbstractFunctionRef>();
                                TList _list90 = iprot.ReadListBegin();
                                for (int _i91 = 0; _i91 < _list90.Count; ++_i91)
                                {
                                    TDDIAbstractFunctionRef _elem92;
                                    _elem92 = new TDDIAbstractFunctionRef();
                                    _elem92.Read(iprot);
                                    SubFunctions.Add(_elem92);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.List)
                        {
                            {
                                Ports = new List <TDDIPort>();
                                TList _list93 = iprot.ReadListBegin();
                                for (int _i94 = 0; _i94 < _list93.Count; ++_i94)
                                {
                                    TDDIPort _elem95;
                                    _elem95 = new TDDIPort();
                                    _elem95.Read(iprot);
                                    Ports.Add(_elem95);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 9:
                        if (field.Type == TType.List)
                        {
                            {
                                Signals = new List <TDDISignal>();
                                TList _list96 = iprot.ReadListBegin();
                                for (int _i97 = 0; _i97 < _list96.Count; ++_i97)
                                {
                                    TDDISignal _elem98;
                                    _elem98 = new TDDISignal();
                                    _elem98.Read(iprot);
                                    Signals.Add(_elem98);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 10:
                        if (field.Type == TType.Struct)
                        {
                            PerfChars = new TDDIPerfChars();
                            PerfChars.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 11:
                        if (field.Type == TType.List)
                        {
                            {
                                FailureModels = new List <TDDIAbstractFailureModelRef>();
                                TList _list99 = iprot.ReadListBegin();
                                for (int _i100 = 0; _i100 < _list99.Count; ++_i100)
                                {
                                    TDDIAbstractFailureModelRef _elem101;
                                    _elem101 = new TDDIAbstractFailureModelRef();
                                    _elem101.Read(iprot);
                                    FailureModels.Add(_elem101);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 12:
                        if (field.Type == TType.List)
                        {
                            {
                                Malfunctions = new List <TDDIMalfunctionRef>();
                                TList _list102 = iprot.ReadListBegin();
                                for (int _i103 = 0; _i103 < _list102.Count; ++_i103)
                                {
                                    TDDIMalfunctionRef _elem104;
                                    _elem104 = new TDDIMalfunctionRef();
                                    _elem104.Read(iprot);
                                    Malfunctions.Add(_elem104);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 13:
                        if (field.Type == TType.Struct)
                        {
                            AsAsset = new TDDIAbstractAsset();
                            AsAsset.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            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.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 _list112 = iprot.ReadListBegin();
                                for (int _i113 = 0; _i113 < _list112.Count; ++_i113)
                                {
                                    TDDIKeyValueMap _elem114;
                                    _elem114 = new TDDIKeyValueMap();
                                    _elem114.Read(iprot);
                                    KeyValueMaps.Add(_elem114);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.List)
                        {
                            {
                                DependabilityRequirements = new List <TDDIAbstractDependabilityRequirementRef>();
                                TList _list115 = iprot.ReadListBegin();
                                for (int _i116 = 0; _i116 < _list115.Count; ++_i116)
                                {
                                    TDDIAbstractDependabilityRequirementRef _elem117;
                                    _elem117 = new TDDIAbstractDependabilityRequirementRef();
                                    _elem117.Read(iprot);
                                    DependabilityRequirements.Add(_elem117);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.Struct)
                        {
                            AssuranceLevel = new TDDIAssuranceLevel();
                            AssuranceLevel.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.List)
                        {
                            {
                                SubFunctions = new List <TDDIAbstractFunctionRef>();
                                TList _list118 = iprot.ReadListBegin();
                                for (int _i119 = 0; _i119 < _list118.Count; ++_i119)
                                {
                                    TDDIAbstractFunctionRef _elem120;
                                    _elem120 = new TDDIAbstractFunctionRef();
                                    _elem120.Read(iprot);
                                    SubFunctions.Add(_elem120);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.List)
                        {
                            {
                                Ports = new List <TDDIPort>();
                                TList _list121 = iprot.ReadListBegin();
                                for (int _i122 = 0; _i122 < _list121.Count; ++_i122)
                                {
                                    TDDIPort _elem123;
                                    _elem123 = new TDDIPort();
                                    _elem123.Read(iprot);
                                    Ports.Add(_elem123);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 9:
                        if (field.Type == TType.List)
                        {
                            {
                                Signals = new List <TDDISignal>();
                                TList _list124 = iprot.ReadListBegin();
                                for (int _i125 = 0; _i125 < _list124.Count; ++_i125)
                                {
                                    TDDISignal _elem126;
                                    _elem126 = new TDDISignal();
                                    _elem126.Read(iprot);
                                    Signals.Add(_elem126);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 10:
                        if (field.Type == TType.Struct)
                        {
                            PerfChars = new TDDIPerfChars();
                            PerfChars.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 11:
                        if (field.Type == TType.List)
                        {
                            {
                                FailureModels = new List <TDDIAbstractFailureModelRef>();
                                TList _list127 = iprot.ReadListBegin();
                                for (int _i128 = 0; _i128 < _list127.Count; ++_i128)
                                {
                                    TDDIAbstractFailureModelRef _elem129;
                                    _elem129 = new TDDIAbstractFailureModelRef();
                                    _elem129.Read(iprot);
                                    FailureModels.Add(_elem129);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 12:
                        if (field.Type == TType.List)
                        {
                            {
                                Malfunctions = new List <TDDIMalfunctionRef>();
                                TList _list130 = iprot.ReadListBegin();
                                for (int _i131 = 0; _i131 < _list130.Count; ++_i131)
                                {
                                    TDDIMalfunctionRef _elem132;
                                    _elem132 = new TDDIMalfunctionRef();
                                    _elem132.Read(iprot);
                                    Malfunctions.Add(_elem132);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 13:
                        if (field.Type == TType.Struct)
                        {
                            AsAsset = new TDDIAbstractAsset();
                            AsAsset.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

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

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

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

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