Ejemplo n.º 1
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("Complex");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (SimpleValue != null && __isset.simpleValue)
         {
             field.Name = "simpleValue";
             field.Type = TType.Struct;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             SimpleValue.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (ListValue != null && __isset.listValue)
         {
             field.Name = "listValue";
             field.Type = TType.List;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, ListValue.Count));
                 foreach (Simple _iter61 in ListValue)
                 {
                     _iter61.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (SetValue != null && __isset.setValue)
         {
             field.Name = "setValue";
             field.Type = TType.Set;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteSetBegin(new TSet(TType.Struct, SetValue.Count));
                 foreach (Simple _iter62 in SetValue)
                 {
                     _iter62.Write(oprot);
                 }
                 oprot.WriteSetEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (MapValue != null && __isset.mapValue)
         {
             field.Name = "mapValue";
             field.Type = TType.Map;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteMapBegin(new TMap(TType.String, TType.Struct, MapValue.Count));
                 foreach (string _iter63 in MapValue.Keys)
                 {
                     oprot.WriteString(_iter63);
                     MapValue[_iter63].Write(oprot);
                 }
                 oprot.WriteMapEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (ListSetMap != null && __isset.listSetMap)
         {
             field.Name = "listSetMap";
             field.Type = TType.List;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Set, ListSetMap.Count));
                 foreach (THashSet <Dictionary <string, List <Simple> > > _iter64 in ListSetMap)
                 {
                     {
                         oprot.WriteSetBegin(new TSet(TType.Map, _iter64.Count));
                         foreach (Dictionary <string, List <Simple> > _iter65 in _iter64)
                         {
                             {
                                 oprot.WriteMapBegin(new TMap(TType.String, TType.List, _iter65.Count));
                                 foreach (string _iter66 in _iter65.Keys)
                                 {
                                     oprot.WriteString(_iter66);
                                     {
                                         oprot.WriteListBegin(new TList(TType.Struct, _iter65[_iter66].Count));
                                         foreach (Simple _iter67 in _iter65[_iter66])
                                         {
                                             _iter67.Write(oprot);
                                         }
                                         oprot.WriteListEnd();
                                     }
                                 }
                                 oprot.WriteMapEnd();
                             }
                         }
                         oprot.WriteSetEnd();
                     }
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (MapList != null && __isset.mapList)
         {
             field.Name = "mapList";
             field.Type = TType.Map;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteMapBegin(new TMap(TType.String, TType.List, MapList.Count));
                 foreach (string _iter68 in MapList.Keys)
                 {
                     oprot.WriteString(_iter68);
                     {
                         oprot.WriteListBegin(new TList(TType.Map, MapList[_iter68].Count));
                         foreach (Dictionary <string, Simple> _iter69 in MapList[_iter68])
                         {
                             {
                                 oprot.WriteMapBegin(new TMap(TType.String, TType.Struct, _iter69.Count));
                                 foreach (string _iter70 in _iter69.Keys)
                                 {
                                     oprot.WriteString(_iter70);
                                     _iter69[_iter70].Write(oprot);
                                 }
                                 oprot.WriteMapEnd();
                             }
                         }
                         oprot.WriteListEnd();
                     }
                 }
                 oprot.WriteMapEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (ListOfList != null && __isset.listOfList)
         {
             field.Name = "listOfList";
             field.Type = TType.List;
             field.ID   = 7;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.List, ListOfList.Count));
                 foreach (List <string> _iter71 in ListOfList)
                 {
                     {
                         oprot.WriteListBegin(new TList(TType.String, _iter71.Count));
                         foreach (string _iter72 in _iter71)
                         {
                             oprot.WriteString(_iter72);
                         }
                         oprot.WriteListEnd();
                     }
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (ListOfListOfList != null && __isset.listOfListOfList)
         {
             field.Name = "listOfListOfList";
             field.Type = TType.List;
             field.ID   = 8;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.List, ListOfListOfList.Count));
                 foreach (List <List <string> > _iter73 in ListOfListOfList)
                 {
                     {
                         oprot.WriteListBegin(new TList(TType.List, _iter73.Count));
                         foreach (List <string> _iter74 in _iter73)
                         {
                             {
                                 oprot.WriteListBegin(new TList(TType.String, _iter74.Count));
                                 foreach (string _iter75 in _iter74)
                                 {
                                     oprot.WriteString(_iter75);
                                 }
                                 oprot.WriteListEnd();
                             }
                         }
                         oprot.WriteListEnd();
                     }
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }