Example #1
0
        public override string ToString()
        {
            var sb   = new StringBuilder("Xtruct2(");
            int tmp7 = 0;

            if (__isset.byte_thing)
            {
                if (0 < tmp7++)
                {
                    sb.Append(", ");
                }
                sb.Append("Byte_thing: ");
                Byte_thing.ToString(sb);
            }
            if ((Struct_thing != null) && __isset.struct_thing)
            {
                if (0 < tmp7++)
                {
                    sb.Append(", ");
                }
                sb.Append("Struct_thing: ");
                Struct_thing.ToString(sb);
            }
            if (__isset.i32_thing)
            {
                if (0 < tmp7++)
                {
                    sb.Append(", ");
                }
                sb.Append("I32_thing: ");
                I32_thing.ToString(sb);
            }
            sb.Append(')');
            return(sb.ToString());
        }
Example #2
0
        public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
        {
            oprot.IncrementRecursionDepth();
            try
            {
                var struc = new TStruct("Xtruct2");
                await oprot.WriteStructBeginAsync(struc, cancellationToken);

                var field = new TField();
                if (__isset.byte_thing)
                {
                    field.Name = "byte_thing";
                    field.Type = TType.Byte;
                    field.ID   = 1;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await oprot.WriteByteAsync(Byte_thing, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if ((Struct_thing != null) && __isset.struct_thing)
                {
                    field.Name = "struct_thing";
                    field.Type = TType.Struct;
                    field.ID   = 2;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await Struct_thing.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (__isset.i32_thing)
                {
                    field.Name = "i32_thing";
                    field.Type = TType.I32;
                    field.ID   = 3;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await oprot.WriteI32Async(I32_thing, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                await oprot.WriteFieldStopAsync(cancellationToken);

                await oprot.WriteStructEndAsync(cancellationToken);
            }
            finally
            {
                oprot.DecrementRecursionDepth();
            }
        }
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("Xtruct2");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (__isset.byte_thing)
         {
             field.Name = "byte_thing";
             field.Type = TType.Byte;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             oprot.WriteByte(Byte_thing);
             oprot.WriteFieldEnd();
         }
         if (Struct_thing != null && __isset.struct_thing)
         {
             field.Name = "struct_thing";
             field.Type = TType.Struct;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             Struct_thing.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (__isset.i32_thing)
         {
             field.Name = "i32_thing";
             field.Type = TType.I32;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             oprot.WriteI32(I32_thing);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }
Example #4
0
        public override int GetHashCode()
        {
            int hashcode = 157;

            unchecked {
                if (__isset.byte_thing)
                {
                    hashcode = (hashcode * 397) + Byte_thing.GetHashCode();
                }
                if ((Struct_thing != null) && __isset.struct_thing)
                {
                    hashcode = (hashcode * 397) + Struct_thing.GetHashCode();
                }
                if (__isset.i32_thing)
                {
                    hashcode = (hashcode * 397) + I32_thing.GetHashCode();
                }
            }
            return(hashcode);
        }
        public override string ToString()
        {
            StringBuilder __sb    = new StringBuilder("Xtruct2(");
            bool          __first = true;

            if (__isset.byte_thing)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Byte_thing: ");
                __sb.Append(Byte_thing);
            }
            if (Struct_thing != null && __isset.struct_thing)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Struct_thing: ");
                __sb.Append(Struct_thing == null ? "<null>" : Struct_thing.ToString());
            }
            if (__isset.i32_thing)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("I32_thing: ");
                __sb.Append(I32_thing);
            }
            __sb.Append(")");
            return(__sb.ToString());
        }