예제 #1
0
 public void Reclaim(FinalThing1 o)
 {
     if (o != null)
     {
         o.IntValue2a = default(int);
         this.instantiator.DiscardFinalThing1(o);
     }
 }
예제 #2
0
        public byte[] Energize(FinalThing1 o)
        {
            int index = 0;

            Energize(o, bytes, ref index, true);
            byte[] result = this.instantiator.AcquireByteArray(index);
            Buffer.BlockCopy(bytes, 0, result, 0, index);
            return(result);
        }
예제 #3
0
 public void Energize(FinalThing1 o, byte[] bytes, ref int index, bool writeTypeId)
 {
     if (writeTypeId)
     {
         bytes[index++] = 22;
     }
     // PRIMITIVE: IntValue1
     bytes[index++] = (byte)((o.IntValue1 >> 24) & 255);
     bytes[index++] = (byte)((o.IntValue1 >> 16) & 255);
     bytes[index++] = (byte)((o.IntValue1 >> 8) & 255);
     bytes[index++] = (byte)(o.IntValue1 & 255);
     // PRIMITIVE: IntValue2a
     bytes[index++] = (byte)((o.IntValue2a >> 24) & 255);
     bytes[index++] = (byte)((o.IntValue2a >> 16) & 255);
     bytes[index++] = (byte)((o.IntValue2a >> 8) & 255);
     bytes[index++] = (byte)(o.IntValue2a & 255);
 }
 public void DiscardFinalThing1(FinalThing1 o)
 {
     // Dispose?
 }
예제 #5
0
        public object Energize(byte[] bytes, ref int index, ushort typeId)
        {
            switch (typeId)
            {
            case 11:
            {
                Thing o = this.instantiator.AcquireThing();
                // PRIMITIVE: IntValue
                o.IntValue =
                    (int)(
                        ((int)bytes[index++] << 24) |
                        ((int)bytes[index++] << 16) |
                        ((int)bytes[index++] << 8) |
                        (int)bytes[index++]
                        );
                return(o);
            }

            case 12:
            {
                // NULL FLAGS
                int nullFlagsIndex = index - 1;
                index += 1;
                FinalObject o = this.instantiator.AcquireFinalObject();
                nullFlagsIndex++;
                // REFERENCE: ThingValue
                if ((bytes[nullFlagsIndex] & (byte)128) > 0)
                {
                    o.ThingValue = (Thing)Energize(bytes, ref index, 11);
                }
                return(o);
            }

            case 22:
            {
                FinalThing1 o = this.instantiator.AcquireFinalThing1();
                // PRIMITIVE: IntValue1
                o.IntValue1 =
                    (int)(
                        ((int)bytes[index++] << 24) |
                        ((int)bytes[index++] << 16) |
                        ((int)bytes[index++] << 8) |
                        (int)bytes[index++]
                        );
                // PRIMITIVE: IntValue2a
                o.IntValue2a =
                    (int)(
                        ((int)bytes[index++] << 24) |
                        ((int)bytes[index++] << 16) |
                        ((int)bytes[index++] << 8) |
                        (int)bytes[index++]
                        );
                return(o);
            }

            case 23:
            {
                FinalThing2 o = this.instantiator.AcquireFinalThing2();
                // PRIMITIVE: IntValue1
                o.IntValue1 =
                    (int)(
                        ((int)bytes[index++] << 24) |
                        ((int)bytes[index++] << 16) |
                        ((int)bytes[index++] << 8) |
                        (int)bytes[index++]
                        );
                // PRIMITIVE: IntValue2a
                o.IntValue2a =
                    (int)(
                        ((int)bytes[index++] << 24) |
                        ((int)bytes[index++] << 16) |
                        ((int)bytes[index++] << 8) |
                        (int)bytes[index++]
                        );
                return(o);
            }

            case 24:
            {
                // NULL FLAGS
                int nullFlagsIndex = index - 1;
                index += 1;
                AbstractReferenceObject o = this.instantiator.AcquireAbstractReferenceObject();
                nullFlagsIndex++;
                // REFERENCE: Thing
                if ((bytes[nullFlagsIndex] & (byte)128) > 0)
                {
                    o.Thing = (AbstractThing)Energize(bytes, ref index);
                }
                return(o);
            }

            default:
                throw new ReferenceTestPatternBufferException("Unrecognized type ID: " + typeId + " ");
            }
        }
예제 #6
0
        public object Energize(byte[] bytes, ref int index)
        {
            ulong vuread_e2gF4LLKmgmj = 0;

            for (int i_bUcUI05wA86c = 0; i_bUcUI05wA86c < 9; i_bUcUI05wA86c++)
            {
                byte b = bytes[index++];
                if (i_bUcUI05wA86c < 8)
                {
                    vuread_e2gF4LLKmgmj += (((ulong)b & (ulong)127) << (7 * i_bUcUI05wA86c));
                    if ((int)(b & 128) == 0)
                    {
                        break;
                    }
                }
                else
                {
                    vuread_e2gF4LLKmgmj += (ulong)b << (7 * i_bUcUI05wA86c);
                    break;
                }
            }
            ushort typeId = (ushort)vuread_e2gF4LLKmgmj;

            switch (typeId)
            {
            case 11:
            {
                Thing o = this.instantiator.AcquireThing();
                // PRIMITIVE: IntValue
                o.IntValue =
                    (int)(
                        ((int)bytes[index++] << 24) |
                        ((int)bytes[index++] << 16) |
                        ((int)bytes[index++] << 8) |
                        (int)bytes[index++]
                        );
                return(o);
            }

            case 12:
            {
                // NULL FLAGS
                int nullFlagsIndex = index - 1;
                index += 1;
                FinalObject o = this.instantiator.AcquireFinalObject();
                nullFlagsIndex++;
                // REFERENCE: ThingValue
                if ((bytes[nullFlagsIndex] & (byte)128) > 0)
                {
                    o.ThingValue = (Thing)Energize(bytes, ref index, 11);
                }
                return(o);
            }

            case 22:
            {
                FinalThing1 o = this.instantiator.AcquireFinalThing1();
                // PRIMITIVE: IntValue1
                o.IntValue1 =
                    (int)(
                        ((int)bytes[index++] << 24) |
                        ((int)bytes[index++] << 16) |
                        ((int)bytes[index++] << 8) |
                        (int)bytes[index++]
                        );
                // PRIMITIVE: IntValue2a
                o.IntValue2a =
                    (int)(
                        ((int)bytes[index++] << 24) |
                        ((int)bytes[index++] << 16) |
                        ((int)bytes[index++] << 8) |
                        (int)bytes[index++]
                        );
                return(o);
            }

            case 23:
            {
                FinalThing2 o = this.instantiator.AcquireFinalThing2();
                // PRIMITIVE: IntValue1
                o.IntValue1 =
                    (int)(
                        ((int)bytes[index++] << 24) |
                        ((int)bytes[index++] << 16) |
                        ((int)bytes[index++] << 8) |
                        (int)bytes[index++]
                        );
                // PRIMITIVE: IntValue2a
                o.IntValue2a =
                    (int)(
                        ((int)bytes[index++] << 24) |
                        ((int)bytes[index++] << 16) |
                        ((int)bytes[index++] << 8) |
                        (int)bytes[index++]
                        );
                return(o);
            }

            case 24:
            {
                // NULL FLAGS
                int nullFlagsIndex = index - 1;
                index += 1;
                AbstractReferenceObject o = this.instantiator.AcquireAbstractReferenceObject();
                nullFlagsIndex++;
                // REFERENCE: Thing
                if ((bytes[nullFlagsIndex] & (byte)128) > 0)
                {
                    o.Thing = (AbstractThing)Energize(bytes, ref index);
                }
                return(o);
            }

            default:
                throw new ReferenceTestPatternBufferException("Unrecognized type ID: " + typeId + " ");
            }
        }