Exemple #1
0
 public StructB(
     StructA aa,
     StructA ab
 ) {
     this.Aa = aa;
     this.Ab = ab;
 }
Exemple #2
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_ab = false;
                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)
                        {
                            Aa = new StructA();
                            Aa.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.Struct)
                        {
                            Ab = new StructA();
                            Ab.Read(iprot);
                            isset_ab = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_ab)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
Exemple #3
0
 public void Read(TProtocol iprot)
 {
     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) {
                     Aa = new StructA();
                     Aa.Read(iprot);
                 } else {
                     TProtocolUtil.Skip(iprot, field.Type);
                 }
                 break;
             case 2:
                 if (field.Type == TType.Struct) {
                     Ab = new StructA();
                     Ab.Read(iprot);
                 } else {
                     TProtocolUtil.Skip(iprot, field.Type);
                 }
                 break;
             default:
                 TProtocolUtil.Skip(iprot, field.Type);
                 break;
         }
         iprot.ReadFieldEnd();
     }
     iprot.ReadStructEnd();
     if (Ab == null)
         throw new TProtocolException(TProtocolException.INVALID_DATA, "missing required property 'Ab'");
 }
Exemple #4
0
 public StructB(StructA ab) : this()
 {
     this.Ab = ab;
 }