public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("TDDISignal");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (__isset.Id)
         {
             field.Name = "Id";
             field.Type = TType.I64;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             oprot.WriteI64(Id);
             oprot.WriteFieldEnd();
         }
         if (Name != null && __isset.Name)
         {
             field.Name = "Name";
             field.Type = TType.String;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Name);
             oprot.WriteFieldEnd();
         }
         if (Description != null && __isset.Description)
         {
             field.Name = "Description";
             field.Type = TType.String;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Description);
             oprot.WriteFieldEnd();
         }
         if (KeyValueMaps != null && __isset.KeyValueMaps)
         {
             field.Name = "KeyValueMaps";
             field.Type = TType.List;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, KeyValueMaps.Count));
                 foreach (TDDIKeyValueMap _iter79 in KeyValueMaps)
                 {
                     _iter79.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (FromPort != null && __isset.FromPort)
         {
             field.Name = "FromPort";
             field.Type = TType.Struct;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             FromPort.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (ToPort != null && __isset.ToPort)
         {
             field.Name = "ToPort";
             field.Type = TType.Struct;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             ToPort.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }
Esempio n. 2
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("TDDISignal");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (__isset.Id)
         {
             field.Name = "Id";
             field.Type = TType.I64;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             oprot.WriteI64(Id);
             oprot.WriteFieldEnd();
         }
         if (Name != null && __isset.Name)
         {
             field.Name = "Name";
             field.Type = TType.String;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Name);
             oprot.WriteFieldEnd();
         }
         if (Description != null && __isset.Description)
         {
             field.Name = "Description";
             field.Type = TType.String;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Description);
             oprot.WriteFieldEnd();
         }
         if (__isset.IsCitation)
         {
             field.Name = "IsCitation";
             field.Type = TType.Bool;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             oprot.WriteBool(IsCitation);
             oprot.WriteFieldEnd();
         }
         if (__isset.IsAbstract)
         {
             field.Name = "IsAbstract";
             field.Type = TType.Bool;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             oprot.WriteBool(IsAbstract);
             oprot.WriteFieldEnd();
         }
         if (KeyValueMaps != null && __isset.KeyValueMaps)
         {
             field.Name = "KeyValueMaps";
             field.Type = TType.List;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, KeyValueMaps.Count));
                 foreach (TDDIKeyValueMapRef _iter70 in KeyValueMaps)
                 {
                     _iter70.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (CitedElement != null && __isset.CitedElement)
         {
             field.Name = "CitedElement";
             field.Type = TType.Struct;
             field.ID   = 7;
             oprot.WriteFieldBegin(field);
             CitedElement.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (DependabilityRequirements != null && __isset.DependabilityRequirements)
         {
             field.Name = "DependabilityRequirements";
             field.Type = TType.List;
             field.ID   = 8;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, DependabilityRequirements.Count));
                 foreach (TDDIAbstractDependabilityRequirementRef _iter71 in DependabilityRequirements)
                 {
                     _iter71.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (AssuranceLevel != null && __isset.AssuranceLevel)
         {
             field.Name = "AssuranceLevel";
             field.Type = TType.Struct;
             field.ID   = 9;
             oprot.WriteFieldBegin(field);
             AssuranceLevel.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (FromPort == null)
         {
             throw new TProtocolException(TProtocolException.INVALID_DATA, "required field FromPort not set");
         }
         field.Name = "FromPort";
         field.Type = TType.Struct;
         field.ID   = 10;
         oprot.WriteFieldBegin(field);
         FromPort.Write(oprot);
         oprot.WriteFieldEnd();
         if (ToPort == null)
         {
             throw new TProtocolException(TProtocolException.INVALID_DATA, "required field ToPort not set");
         }
         field.Name = "ToPort";
         field.Type = TType.Struct;
         field.ID   = 11;
         oprot.WriteFieldBegin(field);
         ToPort.Write(oprot);
         oprot.WriteFieldEnd();
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }